Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1299.Text file parser -- How to extarct specified pattern by conditions?

User: Soly -- 2015-04-23          << 1298  1300 >>
Hits: 1344
Type: Text file parser   
Search all Text file parser examples
Description:
How to extarct by conditions? 
 
only the value of MD is needed to be extracted. but if it doesn't exist, then extract the value of OD.
Input Sample:
File1 
LD="AA" 
MD="BB" 
ND="CC" 
OD="DD" 
 
File2 
LD="AA" 
XD="BB" 
ND="CC" 
OD="DD"
Output Sample:
File1 
BB 
 
File2 
DD
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 'search for pattern' to: 
 
* set 'replace with pattern' to: 
 
* uncheck "print unmatched units" option 
3. click 'replace', done.

Screenshot 1:  Replace_Window


Similar Examples:
How to extract specified text from pdf files? (71%)
How to extract specified interface and sw from router configuration file? (65%)
How to extract text between specified start and end strings? (63%)
How to search specified pattern in a text file and remove spaces in it? (61%)
How to extract specified lines in different section of text file? (60%)
How to add a new line return after specified char combinations? (60%)
How to extract different part from adjacent lines? (59%)
How to batch rename files to the specified pattern found in file content? (59%)

Check Demo of Text file parser
Keywords:
condition  extracte  unmatched  unmatch  specified  value  print  text file parser  file parser  parser  extract value  if then  only search text  extract if  text file search extract  open print file  open print  text file parser open