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: 2029
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 last 100 lines from multiple files? (70%)
How to extract all text enclosed by H1 tag from multiple html files? (69%)
How to extract all http links from multiple web sites in one time? (65%)
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%)

Check Demo of Text file parser
Keywords:
extract all c comments  comments  output to single file  cross line  single  single file  rule  extract all  text file parser  file parser  extract comments c file  c extract all comments  extract c comments  c extract comments from  extract multiple  extract files  replace rule multiple files  replace multiple rule