Avatar of Fr. Vandecan
Fr. Vandecan
Flag for Belgium asked on

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

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 ???
Powershell

Avatar of undefined
Last Comment
Fr. Vandecan

8/22/2022 - Mon
Alex

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.
ASKER CERTIFIED SOLUTION
oBdA

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Fr. Vandecan

ASKER
tks. strange that at the beginning the file was not containing the ""
Anyway, I'm happy with this now that I understand
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23