Convert CSV with powershell

hi folks,

i need a csv convert like this

(import-csv -delimiter ';' c:\export2.csv | convertto-csv -notype -delimiter ',') -replace '"' | out-file c:\export3.csv

Open in new window

but to convert as follows

Z123456;Lastname, Firstname;GAL;MUC;I;2540562;D211206;WEBSH;2013-09-18 13:50:34;New;Mail;MSXC2010;

Open in new window

needs to be change (for all columns above) to this form:

"Z123456","LAstname, Firstname",

Open in new window

Who is Participating?
footechConnect With a Mentor Commented:
Easy enough.
Import-Csv c:\export2.csv -Delimiter ";" | Export-Csv convert2.csv -notype

Open in new window

If you want to save to the same file, you can modify like below.
(Import-Csv c:\export2.csv -Delimiter ";") | Export-Csv c:\export2.csv -notype

Open in new window

QlemoConnect With a Mentor Batchelor and DeveloperCommented:
... and if you want to only have those two fields:
Import-Csv c:\export2.csv -Delimiter ";" | select Userid, Name | Export-Csv convert2.csv -notype

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.