11 Vote

Replacing Semicolons with Commas in CSV Files

Question by Guest | 2023-12-22 at 13:17

I have several CSV files that I would like to change the format of. Specifically, it's about changing the field separator from a semicolon to a comma.

The problem with this is that I can't work with a usual replace function. The normal replacement works across the entire file, but I have to pay attention to the syntax of the CSV data here, as semicolons and commas can also appear in the fields and of course should not be replaced there.

How is it possible to replace syntactic characters such as semicolons or commas in a CSV file without destroying the syntax?

ReplyPositiveNegative
2Best Answer2 Votes

You can complete this task with the actions "CSV > Import Format" and "CSV > Export Format" of the TextConverter.

  1. Add files: First, add all the CSV files you want to change to the file list in the TextConverter.
  2. Activate the function "CSV > Import Format". Here you can specify which field separator (e.g. comma, semicolon or tab) and which field delimiter (e.g. " or ') your original files have. In most cases, "Auto Detect" should be sufficient here.
  3. Next, activate the function "CSV > Export Format". Here you can specify which format your CSV files should receive after the conversion. Again, you can select any type of field separator and field delimiter.
  4. Save files: Finally, you can choose how and where you want your converted files to be saved. You can find the storage options at the bottom right of the main window. Then click on "Convert and Save" to complete the conversion.

By the way, not only the typical characters such as semicolons, commas and tabs can be selected as field separators and field delimiters. Any user-defined characters can be specified via their input or their code point.

If you also want to change the line break type of your CSV files, you can use the settings under "Actions > Files > Line break Type". Here, you can define line break types of your choice for importing and exporting files.
2023-12-22 at 15:25

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.