Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

883.Text file parser -- How to extract all c++ comments from multiple cpp files?

User: editor -- 2011-11-07          << 882  884 >>
Hits: 203
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract all c++ comments from multiple cpp files?
Input Sample:
file1.cpp
//comments1
code; //comments2
.....

file2.cpp
//comments3
.....
Output Sample:
comments.txt:
//comments1
//comments2
//comments3
....
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" menu
2. drag multiple cpp files from "windows file browser" to "Batch Runner" window
3. click "Fast Replace" button
* click "add" to add new rule
* set "search" to: 
* set "replace" to: 
* click "ok"
4. check option of "reg exp" and "extract"
5. uncheck option of "cross line"
6. click "start", and select "output to single file", and select comments.txt as output file, done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to extract and remove common lines from multiple files? (74%)
How to extract all image links from multiple html files?  (74%)
How to extract all lines that contain "abc" from multiple files? (71%)
How to extract all text enclosed by H1 tag from multiple html files? (69%)
How to extract the last non-blank line from multiple text files? (65%)
How to extract all http links from multiple web sites in one time? (65%)
How to extract all lines with numbers from many text files? (65%)
How to extract email addresses from multiple webpages? (65%)

Check Demo of Text file parser
Keywords:
comments  cross line  single  extract all  text file parser  parse  file parser  pars  how to extract  fast replace  extract comments c file  c extract all comments  extract multiple  replace multiple rule  multiple replace rule  replace rule multiple files  replace rule multiple  multiple rule replace