1 |
On 04/02/2014 01:14, Joseph wrote: |
2 |
> I have a text file. How do I search and replace "carriage return"? |
3 |
> |
4 |
|
5 |
|
6 |
That is a horrible one to solve :-) |
7 |
|
8 |
All the usual tools (grep, sed, tr) are line oriented so they will take |
9 |
one line and replace the CR at the end with something else plus a CR! |
10 |
i.e. they don't do multi-line search and replace easily. I usually end |
11 |
up resorting to using a text-editor.... |
12 |
|
13 |
But sed can be persuaded to do it, if your really need a programmatic |
14 |
solution: |
15 |
|
16 |
http://sed.sourceforge.net/sedfaq4.html#s4.23.3 |
17 |
|
18 |
|
19 |
-- |
20 |
Alan McKinnon |
21 |
alan.mckinnon@×××××.com |