A call to sed heads :-)

I have a file that contains something like

somerandomtextwhichidontknowwhatisthere0000somerandomtext000somemorerandomtext

and I want to end up with

somerandomtextwhichidontknowwhatisthere0000hello world000somemorerandomtext

I tried sed and my brain melted :wink:

thanks

M

So does mine.

Can you please give some description on what should be replaced by what, or inserted where and what the criteria are to find the places where to replace/remove/insert. Maybe some bold or so to make that clear.

When you can noy even describe what you want, nobody can program that in any language.

Sorry, thought it was fairly clear

somerandomtextwhichidontknowwhatisthere0000somerandomtext000somemorerandomtext

and I want to end up with

somerandomtextwhichidontknowwhatisthere0000hello world000somemorerandomtext

I don’t know what is in the file except the sub string i want to replace is starts 0000 and ends 0000
and I want to take out whatever is there and replace it with a particular string

A bit more clear. But you saythe second string, the one that ends the string to be replaced, is 0000 (4 zeros), but your example has 000 (4 zeros). See how important it is to be exact ;)?

What about

sed s/0000.*0000/0000helloworld0000/

Many thanks

M