Re: TableExtract and unlabeled columns

Matt Sisk <[email protected]> Wed, 01 Oct 2003 10:30:54 -0500
Newsgroups gmane.comp.lang.perl.modules.html-tableextract
Message-ID <[email protected]>
Kragen Sitaker wrote:
> TableExtract really rocks.  Thank you!

You're welcome. Always nice to hear it's been of some use out there.

> I'm trying to parse a table in which some columns I'm interested in aren't
> labeled.  I can find the rows I want from the contents of the columns that are
> labeled, and if I had the contents of the row, I could find the stuff I want in
> it.

Ah yes. One of the shortcomings of the module -- I've run into this 
problem myself. In a (real soon now) future release, I'll have a 
'keep_all_columns' or something similar that will disable the vertical 
slicing through tables. This sounds like it would solve your problem 
since you'd be able to target on a subset of headers yet retain the 
entire table.

In the meantime, unfortunately, you might have to make two passes on the 
data -- one to target the table (and get it's coordinates), then another 
to extract the whole table from that depth/count. Not the best solution, 
but it would work.

 > But TableExtract doesn't seem to have a way to return the stuff
 > I want --- if I say automap => 0, some other columns are present,
 > but they're returned as empty strings, and they aren't necessarily
 > all the columns in the table.

The 'automap' parameter isn't really doing what you think it's doing. 
It's *supposed* to return columns in the same order as you specify your 
headers, rather than the 'natural order' of the table when disabled. 
It's not supposed to return anything relating to the eliminated columns 
in either case (if it is, it's a bug -- I don't ever disable it so it 
might have escaped my notice).

I've cc'd the list on this for posterity.

Hope this helps,
Matt



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf