Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

664.Text data calculation -- How to calculate the maximum value of the first n lines?

User: Lynne -- 2010-11-25          << 663  665 >>
Hits: 2905
Type: Text data calculation   
Search all Text data calculation examples
Description:
How to calculate the maximum value from the 1st line to each line of text? 
description: 
Such as in the 2nd line, result should be the maximum between the 1st line and 2nd line. And in the 3rd line, the result 
should be the maximum among the 1st line,2nd line and the 3rd line. 
There are 500 lines and 1000 columns in one text file. 
Thank you! 
Input Sample:
        A     B     
Line1 45.97 37.02.. 
Line2 45.00 40.24.. 
Line3 41.00 38.80.. 
Line4 40.34 37.25.. 
Line5 36.27 36.50.. 
Line6 30.09 39.16.. 
Line7 30.30 42.56.. 
Line8 30.05 44.84.. 
Line9 32.86 47.53.. 
        .     .     
        .     .     
                    
Output Sample:
        A    RA     B    RB     
Line1 45.97 45.97 37.02 37.02.. 
Line2 45.00 45.97 40.24 40.24.. 
Line3 41.00 45.97 38.80 40.24.. 
Line4 40.34 45.97 37.25 40.24.. 
Line5 36.27 45.97 36.50 40.24.. 
Line6 60.09 60.09 39.16 40.24.. 
Line7 30.30 60.09 42.56 42.56.. 
Line8 71.05 71.05 44.84 44.84.. 
Line9 32.86 71.05 47.53 47.53.. 
        .     .     .     .     
        .     .     .     .     
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file 
2. ctrl-h open 'replace' window 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
3. click 'Replace', done. 
4. ctrl-s save to file.

Screenshot 1:  Replace_Window


Similar Examples:
How to calculate the minimum and maximum value in each line of text? (71%)
How to calculate sum value of every column? (63%)
How to calculate md5 hex value of each line of text file? (62%)
How to calculate the average of numbers of one column? (61%)
How to calculate the sum of the numbers in the same column? (60%)
How to calculate the absolute average value of every 2 columns? (58%)
How to calculate the summaries of every line in a txt file? (58%)
How to calculate the average of the numbers in the same column? (57%)

Check Demo of Text data calculation
Keywords:
how to calculate the maximum value  500  3rd  maximum  1st  2nd  desc  max  calculate  script  replace value 3rd line file  calculate maximum in text file  calculate lines  first columns  between lines  text to columns open source  calculate text data  save lines from text file