Unanswered: Remove Line Feed Characters from a Load file
We have a file extract from a mainframe which we want to load into DB2 from a Unix scrip.
The row delimiter is CRLF (Carriage Return)(Line Feed) but within some rows there is a LF (Line Feed) non printable character but the Load script sees this as a row delimiter and incorrectly tries to load a new row of data.
How would we remove this character LF from the data or force the load to only use CRLF as the row delimiter.
Attached is an example of the file where the 3rd row has the above mentioned error.
You did not say the flavour of the unix, but many unix versions and all linux typically have the filters 'dos2unix' and 'unix2dos' for this purpose.
If you lack these filters you can simulate them (google helps here).
But usually it is better to arrange that the source system does not place CRLF into the line endings, and also to ensure that the mechanisms used for file copy from source-system to target-system either use a binary copy (when no codepage conversions are needed), or use a copy that does not change the line terminators.