Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Replacing a pattern with a variable
Name: prekida Date: July 26, 2005 at 14:16:54 Pacific OS: Solaris CPU/Ram: 8/16G
Comment:
I need to replace anything immediately after the pattern "standard01/" in a file with the value of a variable I don't know the length of the characters stored in that variable. - that might vary. I know there is some string after the pattern "standard01/", i don't know the what the string is or the length of it. but i know after that string following "standard01/", there is blank space and after that a word called "buf" in that file
So, the string following the pattern "standard01/" for example looks like "special_previlege_datetime.lst" followed by a space and then a string begins with "buf" - when in the process of replacing the value of the variable right after the above pattern "standard01/" - i should not start overwriting the next string "buf" - in other words i should try to replace/write the value of the variable starting immediately after "standard01/" and before the next word "buf" begins.
Please provide your advice. Your help is greatly apprecitaed. Thanks
Summary: Hi, I would like to replace all "mytestcase" with a variable $name. I have a for loop that reads: foreach newname ('more name_list') set name= $newname:r ...
Summary: Hi, I have some data which is comma delimited. How do I change it to be tab delimited? I tried sed 's/,/\t/g' but it just replaced the commas with a t. ...
Summary: I'm trying to replace a string pattern with a new line character. Any ideas how this can be done. I tried a few variants with sed, but no luck. Basically I'm trying to do something like this: Replac...