![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Convert CSV semi-colone to comma separated Hello I have a CSV File for import in AD firstname;lastname;street,description Max;Huber;Street 1;Max Huber, Street 1 >In the description, I have a commas! How convert the csv to comma separated fistname,lastname,street,description Max,Huber,Street 1,"Max Huber, Street 1" You have an idea how this makes? For converting in comma with inverted comma (apostrophe) Thanks Gregor |
My System Specs![]() |
| | #2 (permalink) |
| Windows 7 RC | Re: Convert CSV semi-colone to comma separated Hello I have a CSV File for import in AD firstname;lastname;street,description Max;Huber;Street 1;Max Huber, Street 1 >In the description, I have a commas! How convert the csv to comma separated fistname,lastname,street,description Max,Huber,Street 1,"Max Huber, Street 1" You have an idea how this makes? For converting in comma with inverted comma (apostrophe) Thanks Gregor If I understand your post correctly, you want to replace a ";" with a "," (without the quotes) in a text file. Open the file with notepad. Click on edit, click replace. Put a ; in the find what box, and put a , in the replace with box. That should make the process easier for you. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Convert CSV semi-colone to comma separated Hi I would like this with PowerShell, as Service The CSV is a extract from a other resource Gregor ".Joe" <Joe.37nbhz@xxxxxx-mx.forums.net> wrote in message news:Joe.37nbhz@xxxxxx-mx.forums.net... Quote: > > Gregor;678678 Wrote: Quote: >> Hello >> >> I have a CSV File for import in AD >> >> firstname;lastname;street,description >> Max;Huber;Street 1;Max Huber, Street 1 >In the description, I have a >> commas! >> >> How convert the csv to comma separated >> >> fistname,lastname,street,description >> Max,Huber,Street 1,"Max Huber, Street 1" >> >> You have an idea how this makes? For converting in comma with inverted >> comma >> (apostrophe) >> >> Thanks >> Gregor > Gregor, > > If I understand your post correctly, you want to replace a ";" with a > "," (without the quotes) in a text file. > > Open the file with notepad. Click on edit, click replace. Put a ; in > the find what box, and put a , in the replace with box. That should make > the process easier for you. > > > -- > Joe > > _[image: > http://uswave.net/vistax64/joetmvx64.png] (\"http://www.vistax64.com\")_ > _*::Click_here_for_the_Vista_Forums::* > (\"http://www.vistax64.com/index.php?referrerid=17621\")_ > _Geekbench_Score:_4050 > (\"http://browse.geekbench.ca/geekbench2/view/42901\")_ > _CPU-Z_Verified (\"http://valid.x86-secret.com/show_oc.php?id=323179\")_ > _**_ |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Convert CSV semi-colone to comma separated Split each line from the original CSV file on each ';', if any of the split strings matches a ',' surrounded it with double quotes and join all split strings back with a ','. Then set the modified content to the same, or to another, CSV file. Also, if your encoding is not Unicode --PowerShell's default-- pass it to Get-Content and Set-Content statements through their -Encoding parameter. # modifying same file, using Unicode encoding $csvFile = <path to CSV file> set-content $csvFile (get-content $csvFile | % {[string]::join(',', ($_.split(';') | % {if ($_ -match ',') {"`"$_`""} else {$_}}))}) # test it import-csv $csvFile -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Leading comma operator - What does it do, really? | PowerShell | |||
| semi-locked | Vista General | |||
| do something for each token in a line separated by comma | PowerShell | |||
| Escape comma in dos command from PS script | PowerShell | |||
| Argument that starts with '-' and contains ':' gets separated. | PowerShell | |||