You're viewing a comment by Steve Krampach and its responses.

Steve Krampach Permalink
January 28, 2010, 16:20

I need to substitute
untouched_data untouched_data Data Any Any untouched_data
with
untouched_data Data New New untouched_data

How could that be done?

Let me clarify;
Data will be the item searched for and may appear anywhere in the line
followed by two unknown variables and any amount of following data.

I need to search for "Data" and replace the to next unknown items ("Any")
with two pieces of data specific to "Data"...

ie. Keying off the name "John" for example;

"This is a speech by John M Doe in April"
(Data Any Any = John M Doe)
replacing it with:
"This is a speech by John Quincy Adams in April" (Data New New = John Quincy Adams)

Thank you in advance!

Comment Responses

Gaurav Permalink
May 26, 2012, 09:00

hi Steve,

it can also be done in this way

sed -e 's/untouched_data //2' -e 's/Any/New/g'

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "cdrom_104": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.