I am trying to convert a txt file that includes one long string of data. The lines are separated with hex value 7C (for pipe).
I am trying to process this file using SQR (Peoplesoft) so I thought the easiest thing to do would be to replace the eol char with a CRLF in unix so I can just process as a regular text file in sqr.
The command I am using below replaces EVERY 7 with a ^M and EVERY C with a line feed. What I need, is to replace '7C' with newline or CRLF.
tr '7C' '\r\n' < orig.txt > new.txt
I also tried using sed
sed "s/7C/\n/g" orig.txt > new.txt
but it would only replace 7C with an 'n' and not the line feed that I needed. I have looked at the other threads posted and tried just about all of the suggestions......still no luck so far.
Using tr, can I make the 7C LOOK LIKE 1 character somehow instead of 2? If I could, I would just use the new line (\n) to replace it with.
Yes, I was able to use tr or sed with the | and both worked fine - I replaced with \n in both cases................the only problem is, the file comes in with the hex value for the pipe so I need to be able to convert from 7C to line feed.