User: Verotiana -- 2014-08-12 << 1230 1232 >> |
Hits: 2879 |
Type: Text data calculation |
Search all Text data calculation examples |
Description: |
How to add or subtract a value to a number in a line with a particular word? For example here, add 0.75232 to the number on each line with the word "Transmit" and subtract 0.75232 to the number on each line with "Idle". Can I do it at once or by running a script twice for each pattern? Thank you |
Input Sample: |
1, Time in Transmit mode = 0.302560 1, Time in Receive mode(s) = 3.964960 1, Time in Idle mode(s) = 86395.732480 1, Time in Sleep mode(s) = 0.000000 2, Time in Transmit mode = 0.312800 2, Time in Receive mode(s) = 5.218000 2, Time in Idle mode(s) = 86394.469200 2, Time in Sleep mode(s) = 0.000000 3, Time in Transmit mode = 0.288640 3, Time in Receive mode(s) = 7.530240 3, Time in Idle mode(s) = 86392.181120 3, Time in Sleep mode(s) = 0.000000 |
Output Sample: |
1, Time in Transmit mode = 1.05488 1, Time in Receive mode(s) = 3.964960 1, Time in Idle mode(s) = 86394.98016 1, Time in Sleep mode(s) = 0.000000 2, Time in Transmit mode = 1.06512 2, Time in Receive mode(s) = 5.218000 2, Time in Idle mode(s) = 86393.71688 2, Time in Sleep mode(s) = 0.000000 3, Time in Transmit mode = 1.04096 3, Time in Receive mode(s) = 7.530240 3, Time in Idle mode(s) = 86391.4288 3, Time in Sleep mode(s) = 0.000000 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
You can use one script that contain 2 steps. It looks easier. Following is another approach with only one step: 1. ctrl-o open file 2. ctrl-h open 'replace' dialogue * set 'search for pattern' to: * set 'replace with pattern' to: 3. click 'replace', done. 4. ctrl-s save to file. |
Screenshot 1: Replace_Window |
Similar Examples: |
How to add a specified value to the sequence number in each line? (58%) How to sort all the numbers in each line randomly? (55%) How to add a page number after every 40 lines in a text file? (54%) How to add sequence number for each non-blank line of a text file? (53%) How to add a number in each line indicating number of words in this line? (53%) How to replace all the numbers in a text file to the square value? (51%) How to enclose all the odd number of lines with a pair of tags? (51%) How to remove first number in each line for multiple files? (50%) |
Check Demo of Text data calculation |
Keywords: |
subtract running mode trans scalar script scrip scr calculation sub add line to another line to replace a number with another 2 line in file another replace by script replace once add on value replace another another file |