i have to process 300+ HTML files, extract a string from each one and place it in a separate text file for import downstream. upside: the string format is identical in each file and is +/- two lines from the same position as well.
i thought maybe using Python, but then i thought PERL might be a better way since this kinda plays to it’s backyard.
sadly, i have no access to UNIX/LINUX or i’d just grep it…
this is such an odd client request that i’m a bit goggle-eyed ATM.
so: what is the best way to extract a target string from a BATCH of files?
WR!
If you give us more details (i.e. path and name of the files, the string you want to extract, etc) perhaps I may write a Windows Batch .BAT file to achieve this task…
EDIT
To write a Batch file that successfully run I need a couple additional data, so I made some assumptions. You may help me to fix the details. This is my method:
tdis located in independent lines; this may be fixed.valuestring.for /F skip...command may read a wrong line if thefile contains empty lines; this may be fixed.EDIT no. 2
You are confusing me. Worked the first code or not? The second example you posted in the comments seems not be related to the first one (is the data within second
<td>or after[url=http://?). Is it the same problem or a different one? Please, don’t assume I know about HTML file format (I don’t). I DO know about Batch files, but I can’t guess what to do if I have not complete details…The following Batch file show everything between square brackets that comes IN THE SAME LINE that have the
[url=http://string in the file given in the first parameter: