Search code examples
csvserverhdfsspecial-charactersdelimiter

Change delimiter with sed


I have a file with "\001" delimiter inside a server and I want to change the delimiter to "," and the output to be stored in one file.

I tried this:

sed 's/\001/^/g' /user/home/test.log > /user/home/output.csv

But the output is the same without the new delimiter.


Solution

  • Using tr:

    tr '\001' ',' < /user/home/test.log > /user/home/output.csv