Advice please-best way to approach this
Posted 18 March 2012 - 10:11 AM
Posted 19 March 2012 - 12:06 PM
Batch file (find_vars.bat):
@ECHO OFF FOR /F %%G IN (vars.txt) DO FINDSTR /S /N /C:"%%G" *.c *.h *.py
And of course vars.txt looks like:
DOC files probably won't work, PDF technically should (most postscript is just text) but I can't guarantee it.
/edit I had *.py in there for my testing across a python project.
Also have you looked into search and replace tools?
Edited by SledgY, 19 March 2012 - 12:07 PM.
Posted 19 March 2012 - 09:08 PM
Posted 20 March 2012 - 08:46 AM
FOR /F %%G IN (vars.txt) DO FINDSTR /S /N /C:"%%G" *.c *.h *.py
/F - loop over a text file and populate the variable %%G with each line
/S - search through sub directories
/N - prints the line number prior to each match (added as it's kind of useful information!)
/C - tells findstr to do a literal search using the supplied value, in this case the value stored in the %%G variable
Posted 25 March 2012 - 06:51 AM
Posted 26 March 2012 - 06:33 PM
One option is to use a tool like pdftohtml (from the poppler tool suite, there is a windows version) to extract text and from that do a search.
Alternatively the PyPDF library is a python library that can be used to manipulate and extract text from a PDF file.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users