Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] search and replace "carriage return"
Date: Mon, 03 Feb 2014 23:29:32
Message-Id: 52F0264E.9000003@gmail.com
In Reply to: [gentoo-user] search and replace "carriage return" by Joseph
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

Replies

Subject Author
[gentoo-user] Re: search and replace "carriage return" Grant Edwards <grant.b.edwards@×××××.com>