User: editor -- 2011-11-07 << 882 884 >> |
Hits: 4012 |
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 |