How Do I Change the Delimiter in Linux?
Contents

Using the shell substitution command, all the commas are replaced with the colons. ‘${line/,/:}’ will replace only the 1st match. The extra slash in ‘${line//,/:}’ will replace all the matches. Note: This method will work in bash and ksh93 or higher, not in all flavors.

How do I change the file delimiter?

Step 1

  1. Replace freight_invoice. csv with name of your input file.
  2. Replace output. txt with name you’d like to give your output file.
  3. Replace the semicolon in delimiter=’;’ with a new delimiter of your choice.

How do I change my awk delimiter?

Just put your desired field separator with the -F option in the AWK command and the column number you want to print segregated as per your mentioned field separator.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest