Home > Enterprise >  How to quickly replace all semicolons with commas in a huge csv file on windows?
How to quickly replace all semicolons with commas in a huge csv file on windows?

Time:12-18

I have a 75MB CSV file containing about 2 million rows. I now want to replace all ; characters with comma's. Each line contains six ; characters, so the total number of characters to replace would be around 12 million. Wat is the best tool for this? I am working on windows and tried Notepad 'replace all' functionality, but that keeps freezing due to the size of the file. Any suggestions?

Thanks in advance

CodePudding user response:

Try to make a script wich imports the file as a string, maybe only 100 rows (for loop) and replace... Maybe this works.

I never tried sth like this...

CodePudding user response:

If you have a CSV without errors, you could use the windows beta version of Miller 6.

In example if you have

fieldA;fieldB
1;a
2;"A sample, text"

the command is mlr.exe --csv --ifs ";" --ofs "," cat input.csv >output.csv.

The output is

fieldA,fieldB
1,a
2,"A sample, text"
  • Related