How do I change the delimiter in Unix?

Nguyên Lê

New member
How do I change the delimiter in Unix?
Answer
Shell script to change the delimiter of a file:
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.
 

Tìm kiếm

Back
Top