Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1341.Text file parser -- How to remove paragraphs with different 4th column and last column in second line?

User: Verotiana -- 2016-02-16          << 1340  1342 >>
Hits: 2437
Type: Text file parser   
Search all Text file parser examples
Description:
Remove the pair of lines with the same value of the second column where the  
last non-empty column (i.e with a letter) of the second line does not match  
the 4th column.
Input Sample:
14:55:22.811213, 1545, F, R, C, , , 
, , , , , , , , ,  
14:55:22.985213, 1545, F, R, C, B, , 
, , , , , , , , ,  
14:55:23.997214, 1469, G, R, F, , , , , , , , , , , ,  
14:55:24.043214, 1469, G, R, F, C, B, R, , , , , , , , ,  
14:55:24.806215, 1546, F, R, C, , , 
, , , , , , , , ,  
14:55:24.844215, 1546, F, R, C, B, R, , , , , , , , , ,  
Output Sample:
14:55:23.997214, 1469, G, R, F, , , , , , , , , , , ,  
14:55:24.043214, 1469, G, R, F, C,  
B, R, , , , , , , , ,  
14:55:24.806215, 1546, F, R, C, , , 
, , , , , , , , ,  
14:55:24.844215, 1546, F, R, C, B, R, , , , , , , , , , 
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 'Paragraph' 
* set 'if' to: 
 
* click 'settings' tab: 
* set 'para start' to 'other': 
 
* set 'para end' to 'None' 
3. click 'replace', done. 

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Settings_Window


Similar Examples:
How to reverse the order of the first column in text file? (56%)
How to remove all hyphens after the first tab in each line? (55%)
How to remove duplicate column in each line? (55%)
How to replace the 4th column if the 5th column is 0? (55%)
How to copy the 2nd column to 4th column if 4th column is empty? (54%)
How to remove lines where the last column does not match column 4? (54%)
How to remove lines from file B.csv with first column come from file A.csv? (54%)
How to delete rows with same column as previous line? (54%)

Check Demo of Text file parser
Keywords:
remove paragraphs  empty  remove paragraph  paragraphs  4th  same value  previous  second column  non  second line  empty line  remove empty  replace empty line  remove second line  remove line where  second last line  remove last 3 lines  last lines remove