neyo
March 2, 2008, 4:17pm
1
Hi Guys
How can i change the required information in a file at once
below is the line required to change
[ 'length($6) >= 12 || length($6) <= 10' |awk -F '|' '$6 ~ /^4[5]/ || $6 ~ /^2294[5]/ && $7 ~ /^2299[3]/ ]
change to
[ 'length($7) >= 12 || length($7) <= 10' |awk -F '|' '$6 ~ /^2299[3]/ && $7 ~ /^23[4]/ || $7 ~ /^22923[4]/ ]
Use the # character in your sed "program" instead of a ' to delimt the segments of your sed.
eg
sed s#whatever ```#`# myfile > newfile
neyo
March 3, 2008, 4:19am
3
Thanks Jim for your reply , i executed below as you directed but it produced same information in the real file
sed "s#length($6) >= 12 || length($6) <= 10' |awk -F '|' '$6 ~ /^4[5]/ || $6 ~ /^2294[5]/ && $7 ~ /^2299[3]#length ($7) >= 12 || length($7) <= 10' |awk -F '|' '$6 ~ /^2299[3]/ && $7 ~ /^23[4]/ || $7 ~ /^22923[4]#" test > real
looking at the bigger picture, i feel this is all very messy. You seem to want to change the contents of a script dynamically? Do you need to change it everytime?
neyo
March 3, 2008, 5:16am
5
Hello ghostdog, No i dont need to change everytime , i only need to change once, however i have the scripts in multiple files