logo       

Re: Replacing a pattern in one file by reading a string from anotherfile: msg#00024

editors.sed.user

Subject: Re: Replacing a pattern in one file by reading a string from anotherfile

Kaushik wrote:

> I found out another way(though quite lame , i admit) to do this
> same thing :-
>
> paste 2 3 | sed 's/:/ /g' | awk '{print $3,":",$2}'
> (Here we can always replace the awk part by the sed equivalent)
>
> File 2 contains :
>
> username:SAPextract
> password:$$$$$
> Monthtoextract: October
>
> and File 3 contains :
>
> RunasUser: $username
> RunasPsswd: $password
> RunMonth: $Monthtoextract

Yet another solution, which does the same thing:

paste 3 2 | sed 's/:.*:/:/'

This doesn't need to be so complicated.

--
Eric Pement - eric.pement@xxxxxxxxx



------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/dkFolB/TM
--------------------------------------------------------------------~->

--

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sed-users/

<*> To unsubscribe from this group, send an email to:
sed-users-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/







<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise