Page 1 of 1

Manipulating CRLF

Posted: Mon Feb 25, 2013 1:25 pm
by gigster99
I have a big text file where each line is terminated with CRLF (i.e. a standard windows text file).
I have used unix sed to add a pipe at the end of each line.
Each logical file in the big text file is separated with $$$$.
$$$$ is on its own line.
I have removed the pipe from lines with $$$$.
I now would like to delete "|\r\n" (i.e. pipe CRLF) so that the only line with CRLF is $$$$.
Hopefully I then can read each logical record into a spreadsheet as a separate physical record.
How do I replace pipe CRLF (|\r\n) with a single space?

Posted: Tue Feb 26, 2013 8:25 am
by ben_josephs
Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: \|\n
Replace with: [a space]

[X] Regular expression

Replace All

Posted: Tue Feb 26, 2013 11:52 am
by gigster99
beautiful - works like a charm.
FYI, the initial file size was 1.25GB. I encountered a TextPad error "Out of memory."
I used GNU sed to create 3 smaller files (~ 350 MB each) and your instructions worked perfectly.
Thank you.