I have a file that is a stream of characters, whenever the character ~ (tilda) is found, I need to replace it with ~NL (tilda New_Line) so I can get a file of text lines for further processing. Please help.
Shlomo
What version of Unix are you using? By definition, if your file is a stream of characters, the file is one long line. The older legacy Unix (i.e. Solaris, HP-UX, AIX, etc ) tools will fail with a "line too long error". The GNU Linux tools generally don't have this problem - at least I have never seen it: This command has the best chance of working:
perl -wpl -e 's/~/~\n/g;' file.txt > newfile.txt
Thank you very much Nails; this does the job beautifully.
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |