I'm trying to get my script to parse a bunch of files and grab data between the <title></> and <blah></> tags. Yes yes, I'm parsing html with regex, it works though. :)
The issue I have is sometimes there is one line, sometimes 30 lines, between <title> and <blah> so I can't just .+ it all the way. Plus there are multiple <blah> tags in each file. I'm looking for a way for to scan the file...
User Profile
Collapse
-
Newbie...parsing from multiple lines.
-
...Code:$dir = "c:\\script"; $outdir = "c:\\newfiles"; ### DO NOT EDIT BELOW ### $i=1; print "Opening $dir\n"; opendir(DH,$dir); while (defined ( my $filename = readdir(DH))) { $outfilename=">\\$outdir\\$filename"; print "Opening $filename\n"; open(FHI,$filename); while (<FHI>) { $html .= $_; } -
Parse multiple files...
I feel like a goon. I had a script that would do this but I deleted it long ago without even thinking. Please if someone could help I would REALLY appreciate it.
I'm looking for a script that will read all of the files in a directory and pull the data between two sets of tags and put it in a tab delimited file. Such as, find:
<span class."inv">(.+ ?)<\/span>
-AND-
<td class."lister"> (.+?)<\/td>...
No activity results to display
Show More
Leave a comment: