User: editor -- 2010-12-21 << 680 682 >> |
Hits: 2932 |
Type: Text data calculation |
Search all Text data calculation examples |
Description: |
How to calculate sum value of every column and keep original columns in text file? |
Input Sample: |
Line1 AA-01 45.97 Line2 AA-02 45.00 Line3 AA-03 41.00 Line4 AA-04 40.34 Line5 AA-05 36.27 Line6 AA-06 60.09 |
Output Sample: |
Line1 AA-01 45.97 45.97 Line2 AA-02 45.00 45.00+45.97 Line3 AA-03 41.00 41.00+45.00+45.97 Line4 AA-04 40.34 40.34+41.00+45.00+45.97 Line5 AA-05 36.27 36.27+40.34+41.00+45.00+45.97 Line6 AA-06 60.09 60.09+36.27+40.34+41.00+45.00+45.97 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume the first column is string, all other columns are numbers you need to calculate. Following procedure will keep column 1 untouched, and output the rest columns together with summary. 1. ctrl-o open source text file 2. ctrl-h open replace window * set 'replace unit' to 'Line' * set 'replace with pattern' to: * click 'Advanced' tab, set 'run following for each match unit' to: 3. click 'replace', done. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |