Manipulating CRLF

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
gigster99
Posts: 2
Joined: Mon Feb 25, 2013 1:14 pm
Location: STL
Contact:

Manipulating CRLF

Post 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?
gig graham
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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
gigster99
Posts: 2
Joined: Mon Feb 25, 2013 1:14 pm
Location: STL
Contact:

Post 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.
gig graham
Post Reply