in reply to remove a specific character occuring in file using script

you want to change "../foo" to ../foo?
see example:
blah.txt:
"../foo.blah" rara wewe wewe rara wewe wewe rara "../bar.blah"
then perform:
perl -pi -e 's/\"(\.\.\/.*?)\"/$1/g' blah.txt
update only foo.blah? use:
perl -pi -e 's/\"(\.\.\/foo\.blah)\"/$1/g' blah.txt

that results in:
../foo.blah rara wewe wewe rara wewe wewe rara "../bar.blah"
Update 2 ah, if you'd use code tags, it would have been clear to me...
perl -pi -e 's/(source.*?)\"(\.\.\/.*)\"/$1$2/g' blah.txt

Replies are listed 'Best First'.
Re^2: remove a specific character occuring in file using script
by Anonymous Monk on Feb 10, 2005 at 08:14 UTC
    the solution you had suggested works fine , but problem is that i do not want to remove all occurences of '' in the file. i had told you i want the specific statement source "../xxx.cmd" to be replaces as source ../xxx.cmd. i want only this type of statements not all .