[was] Scripting help please [now] sed help
From: Shawn Bierman (BiermanS_at_METHODISTHEALTH.ORG)
Date: 05/04/05
- Previous message: G V Raju: "Re: Scripting help please"
- Next in thread: Prasad Pillarisetti: "Re: [was] Scripting help please [now] sed help"
- Maybe reply: Prasad Pillarisetti: "Re: [was] Scripting help please [now] sed help"
- Reply: Michael Cheselka: "Re: [was] Scripting help please [now] sed help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 4 May 2005 08:59:13 -0500 To: aix-l@Princeton.EDU
Yeah I blundered.
Isn't there a way to have sed replace "from here onward"?
I know you can do: s/old/new/2
which will replace the second occurrence but how about from the second
occurrence on?
like:
s/old/new/2$ (that doesn't work but maybe you get the idea. The '$'
means to end of line)
-shawn
>>> prasad@IDC.CENDURA.COM 5/4/05 8:20:43 AM >>>
Shawn,
Thanks for the help.
But one glitch, I need to output the whole line, not just the string
after the $.
109889-01 : 109353-04,109353-04 : : $ SUNWkvmx* SUNWkvm * SUNWctu*
-----Original Message-----
From: Shawn Bierman [mailto:BiermanS@METHODISTHEALTH.ORG]
Sent: Wednesday, May 04, 2005 6:40 PM
To: aix-l@Princeton.EDU
Subject: Re: Scripting help please
Like this?
biermans@sf1n04en4:/home/biermans > cat xxx
109889-01 : 109353-04,109353-04 : : $ SUNWkvmx, SUNWkvm, SUNWctu,
SUNWmdb
biermans@sf1n04en4:/home/biermans > cat xxx|awk -F'$' '{print $2}'|sed
-e's/,/*/g'
SUNWkvmx* SUNWkvm* SUNWctu* SUNWmdb
>>> prasad@IDC.CENDURA.COM 5/4/05 7:59:13 AM >>>
I need some scripting help please.
I have a file which has the following output.
I need to change the commas after the $ to a * (or any other character
other than a comma).
Only the commas after the $ need to be changed.
109889-01 : 109353-04,109353-04 : : $ SUNWkvmx, SUNWkvm, SUNWctu,
SUNWmdb
Thanks in advance
Prasad
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005 -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 5/3/2005
- Previous message: G V Raju: "Re: Scripting help please"
- Next in thread: Prasad Pillarisetti: "Re: [was] Scripting help please [now] sed help"
- Maybe reply: Prasad Pillarisetti: "Re: [was] Scripting help please [now] sed help"
- Reply: Michael Cheselka: "Re: [was] Scripting help please [now] sed help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|