Change values inside of a file

September 26, 2011 at 05:01:43
Specs: Linux/VMWare
Hi everyone!

Need a help to don't need to redo all the work again...

I have several files in the same directory with a list of numbers that I need to subtract 1000 (-1000) on each of these values, but only for the numbers between the equal (=) and comma (,)... the contents of these files are on the format bellow.

(362)=3056.0, (458)=3061.0, (538)=3064.0, (617)=3069.0, (682)=3068.0,
(7370)=2617.0, (7402)=2618.0, (7418)=2627.0, (7433)=2630.0, (7442)=2629.0,

In this case I would need the values as:

(362)=2056.0, (458)=2061.0, (538)=2064.0, (617)=2069.0, (682)=2068.0,
(7370)=1617.0, (7402)=1618.0, (7418)=1627.0, (7433)=1630.0, (7442)=1629.0,

Anyone has an idea of how to do this? Could be in batch or Perl...

Thanks! :D


See More: Change values inside of a file

Report •


#1
September 26, 2011 at 18:38:20
Not enough information about the files.

1. Is there a header line?
2. Is what you posted a complete line?


Please come back & tell us if your problem is resolved.


Report •
Related Solutions


Ask Question