perl - search and replace multiple numbers in a file -


i trying inline search , replace in file using perl 5.10.1

when search number 73.10 , replace 73.20. finds 73100.25 , replaces 73.200.25 , 73.10 73.20.

the file has 6 columns appear below:

text text text 73100.25 25.12 text

text text text 365.8 96.25 text

text text text 23189.73 73.10 text

how ensure not replace wrong number?

`/usr/bin/perl -p -i -e "s/$num1/$num3/g" new_info.txt`; `/usr/bin/perl -p -i -e "s/$num2/$num4/g" new_info.txt`; 

perl -i -pe 's/\q$num1\e/$num3/g' new_info.txt 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -