I need to be able to take the data below and get into a db or .csv. Issue is the data isn’t delimited at all. Its just line after line of 166 characters (17 columns without headings).
Data example
01/30/14 09:56:23 Data Received: 300114 0956 00824 9 12345 111 111 111 0 0 12345
01/30/14 09:56:23 Data Received: 300114 0956 00553 9 12345 111 111 111 0 0 12345
01/30/14 09:56:23 Data Received: 300114 0956 00136 7 1 111 01234567890# 12345 111 0 0 12345
01/30/14 09:56:23 Data Received: 300114 0956 00016 9 12345 1234567890 111 111 0 0 12345 1234567890
Below replaces the whitespace with commas, but all on one line. Is it possible to do this so the lines stay in tact inputting commas?
((Get-Content "$Env:USERPROFILE\Desktop\test.txt") -split '\s+' | Foreach-object { "$_" } ) -join ',' | out-file "$Env:USERPROFILE\Desktop\test2.txt"
Thanks