[WNYLUG-Users] sed

Pete Cummings pete at linuxcowboy.com
Thu Feb 18 07:15:52 EST 2010


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
>
>   




More information about the Users mailing list