We help IT Professionals succeed at work.

Export-Csv - why is PowerShell adding delimiter "" - how to avoid this

Fr. Vandecan
Fr. Vandecan asked
on
85 Views
Last Modified: 2018-09-28
Export-Csv - why is PowerShell adding delimiter ""

Export-Csv -Path $CSVFile -Encoding UTF8 –delimiter ";" -NoTypeInformation


I have a csv file with this content (before Export)

ExportedOn;Process;DateValue;LogonName;FirstName;LastName;Function;SiteCode;Departement;AppGap;AppSmile;Intranet;Desktop;LapTop;GSM;SmartPhone;VPNAccess;ResetADRights;SDTicket;RFPD
24/07/2018 05:36;Create;02/11/2019 00:00;flastnamei;firstname;lastname;Stagiaire;SI;Job Coaching Bruxelles;FALSE;FALSE;TRUE;FALSE;TRUE;FALSE;FALSE;TRUE;;;


when i use the command

Export-Csv -Path $CSVFile -Encoding UTF8 –delimiter ";" -NoTypeInformation
the file is changed like this

"ExportedOn";"Process";"DateValue";"LogonName";"FirstName";"LastName";"Function";"SiteCode";"Departement";"AppGap";"AppSmile";"Intranet";"Desktop";"LapTop";"GSM";"SmartPhone";"VPNAccess";"ResetADRights";"SDTicket";"RFPD"
"24/07/2018 05:36";"Create";"02/11/2019 00:00";"flastname";"firstname";"lastname";"Stagiaire";"SI";"Job Coaching Bruxelles";"FALSE";"FALSE";"TRUE";"FALSE";"TRUE";"FALSE";"FALSE";"TRUE";;"";""

"" are added which is really annoying….

why ???
Comment
Watch Question

AlexA lack of information provides a lack of a decent solution.
CERTIFIED EXPERT

Commented:
Ok

Run

Export-Csv -Path $CSVFile -NoTypeInformation

Open in new window


Don't stipulate the delimiter or the encoding and see how you get on. If that doesn't work, use UNICODE and not UTF.
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Fr. VandecanTechnology Sweeper

Author

Commented:
tks. strange that at the beginning the file was not containing the ""
Anyway, I'm happy with this now that I understand
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.