in reply to HTML-Parser: a newbie question: need to extract exactly line 999 out of 5000 files..
Look forward to any and all ideas.
I'd use perl -ne"$. == 999 and print" > all999lines.txt to put all the lines in one file.
Then something like:
#! perl -slw use strict; use Data::Dump qw[pp]; while( <> ) { my %record = m[ <strong>([^<]+?):</strong>.+? >\s*([^<]+?)\s*</(?:a|td)> ]xg; pp \%record; }
Output:
c:\test>junk72 { "E-Mail" => "Keine Angabe", Fax => "0000736111/680040", Internet => "www.mysite.es", adresse_two => "no_value", aresss => "Friedrichstr. 70, 73430 Madrid", country => "contryname", employees => 259, name => "myname one", officer => "no_value", offices => 8, telefone => "0000736111/680040", "the office" => "mysite_two", type => "type_one (04313488)", worker => "no_value", }
Once you have the record in a hash, pushing into the db shouldn't be a problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML-Parser: a newbie question: need to extract exactly line 999 out of 5000 files..
by Perlbeginner1 (Scribe) on Oct 16, 2010 at 09:36 UTC |