Skip to content
Advertisement

How to replace unicode character in file?

I’m reading one file using java and using “u0001” as a field separator. This file is present in linux machine.

But when I do head filename, I can’t see “u0001” as field separator in file. May I know please how can I see the field separator in file on terminal ? How to replace “u0001” with something else on terminal ?

Advertisement

Answer

If you just want to use a different character when displaying the file to make it more human readable:

tr $'u0001' ',' < thefile.txt

(Assuming you’re using bash or another shell that supports $'string' style escapes)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement