Hi - writing a ksh script to parse a datafile and alter various
characters to control characters (on a solaris 9 system if that makes a
difference).
For example, a line starting with a "1" needs to have the 1 replaced by
a linefeed i.e. Control L... no problems, I write my sed command
sed 's/^1/^L/' file > tmpfile
(where ^L is actually control L as typed in vi)
However, similarly "0" needs to be replaced by a linefeed - control J.
But of course I can't actually enter control J in vi (my editor of
choice) not even if I precede it with control V. All that happens is I
get a real line feed within the script which then (of course) does not
parse syntactically when I try and run it.
sed works fine this way oif done from the command line but thgis needs
to be scripted so it runs via cron...
How can I script this such that my zeroes in column one of a line in a
file gets replaced by a control J?
cheers!
ian