Re: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Randall R Schulz
On Thursday 16 August 2007 01:52, Jan Engelhardt wrote: > On Aug 16 2007 11:26, Mark Goldstein wrote: > >> > I would like to insert a new line on each second line, like > >> > that: > >> > >> Quick and easy; > >> for i in `cat pre.txt`; do echo -e "$i\n"; done >after.txt > > That will not work, and

RE: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Ted Harding
On 16-Aug-07 08:15:04, Alexey Eremenko wrote: > Hi all ! > > I would like to insert a new line on each second line, like that: > > > pre.txt: > line1 > line2 > line3 > > After.txt: > line1 > > line2 > > line3 > > I have found the "echo -e "\n" " command to actually insert a new > line, but h

Re: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Jan Engelhardt
On Aug 16 2007 11:26, Mark Goldstein wrote: >> > >> > I would like to insert a new line on each second line, like that: >> >> Quick and easy; >> for i in `cat pre.txt`; do echo -e "$i\n"; done >after.txt That will not work, and for good. You should never-never-never use "for i in `something`" for

Re: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Mark Goldstein
Hi, On 8/16/07, Magnus Boman <[EMAIL PROTECTED]> wrote: > On Thu, 2007-08-16 at 10:15 +0200, Alexey Eremenko wrote: > > Hi all ! > > > > I would like to insert a new line on each second line, like that: > > > > > > pre.txt: > > line1 > > line2 > > line3 > > > > After.txt: > > line1 > > > > line2 >

Re: [opensuse] How to insert lines into text file ?

2007-08-16 Thread Magnus Boman
On Thu, 2007-08-16 at 10:15 +0200, Alexey Eremenko wrote: > Hi all ! > > I would like to insert a new line on each second line, like that: > > > pre.txt: > line1 > line2 > line3 > > After.txt: > line1 > > line2 > > line3 > > I have found the "echo -e "\n" " command to actually insert a new >

[opensuse] How to insert lines into text file ?

2007-08-16 Thread Alexey Eremenko
Hi all ! I would like to insert a new line on each second line, like that: pre.txt: line1 line2 line3 After.txt: line1 line2 line3 I have found the "echo -e "\n" " command to actually insert a new line, but how to automate the process so every second line will get a new line ? please help