Gentoo Archives: gentoo-user

From: Joseph <syscon780@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] search and replace "carriage return"
Date: Tue, 04 Feb 2014 02:37:37
Message-Id: 20140204023751.GD6850@syscon7.ed.shawcable.net
In Reply to: Re: [gentoo-user] search and replace "carriage return" by Mike Gilbert
1 On 02/03/14 18:52, Mike Gilbert wrote:
2 >On Mon, Feb 3, 2014 at 6:14 PM, Joseph <syscon780@×××××.com> wrote:
3 >> I have a text file. How do I search and replace "carriage return"?
4 >>
5 >
6 >Do you mean carriage return (decimal 13) or line feed (decimal 10)?
7 >
8 >The former is pretty simple:
9 >
10 >sed -e 's:\r: :g' foo.txt
11 >
12
13 The command I tried: cat 15.txt | tr '\n' ' ' > 18.txt
14 worked on one file but not on other files.
15
16 I've tried sed -e 's:\r: :g' 15.txt as well
17 doesn't work.
18
19 Here is text example from that file:
20 ...
21 Their skulls were very blocky.
22 Teeth were
23 very small and leaf shaped.
24 In some, but not all ankylosaurs the end
25 of the tail was
26 modified to form a tail club with the huge
27 osteoderms at the tip.
28 ...
29
30 --
31 Joseph