I have a text file containing data like this:
This is just text
-------------------------------
Username: SOMETHI C: [Text]
Account: DFAG Finish time: 1-JAN-2011 00:31:58.91
Process ID: 2028aaB Start time: 31-DEC-2010 20:27:15.30
This is just text
-------------------------------
Username: SOMEGG C: [Text]
Account: DFAG Finish time: 1-JAN-2011 00:31:58.91
Process ID: 20dd33DB Start time: 12-DEC-2010 20:27:15.30
This is just text
-------------------------------
Username: SOMEYY C: [Text]
Account: DFAG Finish time: 1-JAN-2011 00:31:58.91
Process ID: 202223DB Start time: 15-DEC-2010 20:27:15.30
Is there a way to extract Username, Finish time, Start time from this kind of data? I’m looking for some starting point usign R or Powershell.
R may not be the best tool to process text files, but you can proceed as follows: identify the two columns by reading the file as a fixed-width file, separate the fields from their value by splitting the strings on the colons, add an “id” column, and put everything back in order.