Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1282.Text file parser -- How to extract specified lines in different section of text file?

User: editor -- 2015-02-25          << 1281  1283 >>
Hits: 3209
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract specified lines in different section of text file? 
Need to extract: 
line1 of 1st section 
line3 of 2nd section 
line3 of 3rd section 
line4 of 4th section 
 
Each section start with SUB
Input Sample:
DOC_START 
SECTION 
SUB_010_SAISON 
spring 
summer 
autumn 
winter 
SECTION 
SUB_020_TEMPERATURE 
ice-cold 
cold 
warm 
hot 
SECTION 
SUB_030_CLOTHING 
thermalJacket 
jacket 
T-shirt 
Noting 
SECTION 
SUB_040_LAISURE 
fishing 
SwimmingPool 
Lecture 
cycling 
Output Sample:
spring 
warm 
T-shirt 
cycling 
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' dialogue 
* set 'search for pattern' to: 
 
* set 'replace with pattern' to: 
 
* uncheck 'Print unmatched unit' option 
3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to batch extract specified lines from a text file? (76%)
How to extract all specified date format from a text file? (73%)
How to extract specified text followed by 8 digits from text file? (72%)
How to extract specified lines in multiple excel(csv) files? (70%)
How to exract specified strings started with www from text file? (69%)
How to parse all the fields in different segment from a text file? (69%)
How to extract specified columns from blocks of text? (67%)
How to extract all specified links from a html file? (67%)

Check Demo of Text file parser
Keywords:
4th  extract specified lines  how to extract specified lines  3rd  1st  2nd  sub  specified line  unmatched  unmatch  text file search extract lines  text parser to extract lines  open source text file parser  text file parser open source  text parser open source  open source text parser  open source file parser  extract replace source text