Hi,
There is a txt file, I have updated which I need to convert to a csv file. The txt file looks something like this.
Count,Test Number
----------------------------------------------------------------- ----------
46,003201 3
14,008131 2
8,003150 1
I am running this piece of script
Import-Csv C:\VPS\newfile.txt |
Where-Object {$_.Count -notmatch '----'} |
export-csv C:\VPS\newfile3.csv -notypeHowever the output does not seem to work. This is what I get.There are spaces as you see below.
"Count","Test Number "
"46","003201 3 "
"14","008131 2 "
"8","003150
1 "
I am trying to create a csv file with the correct format. This is what I am expecting.
"Count","Test ", "Number"
"46","003201" ,"3"
"14","008131","2"
"8","003150","1"
Please assist.