Read file with name=value

Welcome Forums General PowerShell Q&A Read file with name=value

Viewing 1 reply thread
  • Author
    Posts
    • #210885
      Participant
      Topics: 8
      Replies: 11
      Points: 130
      Rank: Participant

      Hello,

      I have log file with contents like below:

      date=2020-03-17 time=20:56:17 logid=”0000000013″ type=”traffic” subtype=”forward” ……..
      
      date=2020-03-17 time=20:56:27 logid=”0000000013″ type=”traffic” subtype=”forward” ……..
      
      date=2020-03-17 time=20:56:37 logid=”0000000013″ type=”traffic” subtype=”forward” ……..

      I tried read it with ConvertFrom-CSV but have strange results…

      Does someone have and idea how to read such content and create from it object with named parameters like “date”, “time”, “logid”, etc.

      Best Regards

      Daniel

      • This topic was modified 2 months, 2 weeks ago by kolaborek08.
      • This topic was modified 2 months, 2 weeks ago by kolaborek08.
      • This topic was modified 2 months, 2 weeks ago by kolaborek08.
    • #210897
      Participant
      Topics: 4
      Replies: 2249
      Points: 5,494
      Helping Hand
      Rank: Community MVP

      When you post code or sample data or console output you should format it as code using the code tags “PRE” … please read the instructions: Read Me Before Posting! You’ll be Glad You Did!

      For your task you should take a little time and watch this video. It will teach you everything you need:

      Sophisticated Techniques of Plain Text Parsing

Viewing 1 reply thread
  • You must be logged in to reply to this topic.