E
eeb4u
I would like to insert a pipe char at the beginning of certain lines in
a data file. I would like this to occur whenever a line ends with a
pipe.
The file has many records, with normally a two lines per record
(sometimes three). The first line is a "header" and the second is the
text. The pipe is a delimiter.
below is a short data example:
field 1|field 2|field 3|
text text text text text
field 1|field 2|field 3|
text text text text text
field 1|field 2|field 3|
text text text text text
I need the pipe before field 1, another process will look for this pipe
to identify a header line.
text lines never contain pipe chars.
Using perl, can I accomplish this or should I use sed etc. I have been
using perl to get the data into this format, but I am open to
suggestions
thanks for any advice,
Mike Dundas
a data file. I would like this to occur whenever a line ends with a
pipe.
The file has many records, with normally a two lines per record
(sometimes three). The first line is a "header" and the second is the
text. The pipe is a delimiter.
below is a short data example:
field 1|field 2|field 3|
text text text text text
field 1|field 2|field 3|
text text text text text
field 1|field 2|field 3|
text text text text text
I need the pipe before field 1, another process will look for this pipe
to identify a header line.
text lines never contain pipe chars.
Using perl, can I accomplish this or should I use sed etc. I have been
using perl to get the data into this format, but I am open to
suggestions
thanks for any advice,
Mike Dundas