Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1346.Text data calculation -- How to calculate time difference of two adjacent and matched lines?

User: Verotiana -- 2016-02-21          << 1345  1347 >>
Hits: 2442
Type: Text data calculation   
Search all Text data calculation examples
Description:
How to calculate the time (1st column) difference between two consecutive  
lines where the 2nd and 5th columns are the same, and the 5th column is non  
empty? Output the 1st, 2nd, 3rd columns of the 2nd line, and the result. 
Thanks
Input Sample:
13:26.704,21, E, R, R, , , , , , , , , , , ,  
13:28.620,22, E, R, R, , , , , , , , , , , ,  
13:30.586,23, E, R, C, , , , , , , , , , , ,  
13:30.622,23, E, R, C, R, , , , , , , , , , ,  
13:32.624,24, E, R, C, , , , , , , , , , , ,  
13:32.630,24, E, R, C, D, , , , , , , , , , ,  
13:32.636,24, E, R, C, D, R, , , , , , , , , ,  
16:51.094,134, F, R, E, , , , , , , , , , , ,  
16:51.113,134, F, R, E, , , , , , , , , , , ,  
16:51.160,134, F, R, E, D, , , , , , , , , ,  
16:51.169,134, F, R, E, D, R, , , 
Output Sample:
13:30.622 23 E 0.036 
13:32.630 24 E 0.006 
13:32.636 24 E 0.006 
16:51.113 134 F 0.019 
16:51.160 134 F 0.047 
16:51.169 134 F 0.009 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* uncheck 'print unmatched unit' option 
* set 'replace with pattern' to: 
 
* set 'if' to: 
 
* click 'advanced' tab: 
* set 'run following at the begining of replace' to: 
 
 
3. click 'replace', done.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to calculate the number of days between every two adjacent dates? (64%)
How to extract different part from adjacent lines? (63%)
How to calculate the maximum value of the first n lines? (56%)
How to calculate the summaries of different EMA based on close values in stock? (56%)
How to change the even sequence id of the comma to space in each line? (56%)
How to add a space in the middle of the two characters in each line? (54%)
How to split a text file to different files according to first word in each line? (52%)
How to calculate the percentage of the number in the column1? (52%)

Check Demo of Text data calculation
Keywords:
difference  empty  begining  5th  adjacent  3rd  consecutive  onsecutive  previous  1st  empty line  replace empty line  begining with  consecutive words  between two words  replace begining  adjacent lines  adjacent line