[WNYLUG-Users] sed

RussellHarrington at gmail.com RussellHarrington at gmail.com
Thu Feb 18 09:00:53 EST 2010


Or this also works

sed 's/^/\$\$ Ge 1:/' orig.txt > new.txt

On Feb 18, 2010 7:15am, Pete Cummings <pete at linuxcowboy.com> wrote:
> You'll have to go back and fix the first and last lines, but this will  
> work:



> %s/\n/\r\$\$ Ge 1:/g







> paul at paulcosta.com wrote:

> > Hey Guys.

> >

> > I have a bunch of text files that I need to manipulate.

> > I can manually do it in a text editor but it would take many many hours

> >

> > I think sed can do what I want but I don't know how

> > I am reading sed documentation but I need help

> >

> > I want to insert text at the beginning of each line

> > then make the words that follow it start a new line

> >

> > example:

> >

> > This is the original text file

> >

> > 1 some text on this line

> > 2 some text on this line

> > 3 some text on this line

> >

> >

> > This is what I want it to end up like

> >

> > $$ Ge 1:1

> > some text on this line

> > $$ Ge 1:2

> > some text on this line

> > $$ Ge 1:3

> >

> > I want to keep the original numbers that each line has

> > and insert $$ Ge 1: so it looks like $$ Ge 1:1

> > and start the text that follows to a new line

> >

> > any help would be appreciated

> >

> > paul

> >

> >

> >

> > _______________________________________________

> > Users mailing list

> > Users at wnylug.org

> > http://wnylug.org/mailman/listinfo/users_wnylug.org

> >

> >





> _______________________________________________

> Users mailing list

> Users at wnylug.org

> http://wnylug.org/mailman/listinfo/users_wnylug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://wnylug.org/pipermail/users_wnylug.org/attachments/20100218/8b869834/attachment.html>


More information about the Users mailing list