I would like to be able to retrieve specific lines of text from a TXT file and load into an Excel spreadsheet.
The file I am retrieving the text from has 5 lines of data that repeats several times in the file but each line ends with unique data. I want to be able to drop each line into a separate column in Excel. Example: Line 2 in column one, Line 4 in column two.
Then every line that starts the same as Line 2 will go to column one.
I am thinking I need to use Get-Content to grab all the text from the file but how do I find specific lines in the text and export them to an excel spreadsheet?