I have a file that is ouput with | as the delimiter. However, one of the fields is a description field from the source system which contains carriage returns. This is an issue when trying to read the file as it breaks it on to a new line. What I would like to do is remove all CF/LF that aren't preceeded by a |.
I feel like this should be possible on command line but haven't been able to come up with it.
Sample data
|A|Testing CF/LF
This|CF/LF
Expected Output
|A|Testing This|CF/LF
I used a file named
q26895698.txtcontaining your data (such as it was) for my testing.Produces newfile.txt
Can't help but get the impression that you'd be better off with
SEDthouh - google "GNU SED" for details...