Extract complete tables
Top  Previous  Next

Related example macro: Demo-Extract-Table

To extract a complete table with only one command you can use

EXTRACT POS=3 TYPE=TXT ATTR=<TABLE*  

The
!EXTRACT variable now contains the entire information of the table. And iMacros has done more! It has put a #NEXT# tag between adjacent table elements and a #NEWLINE# tag at the end of every table row. These tags are automatically translated into comas and newlines when you use the SAVEAS TYPE=EXTRACT command, such that the following table

Order#
Item
Price (US$)
331-445
Book
29.95
444-555
CD-ROM
15.00


will, when using this command

SAVEAS TYPE=EXTRACT FOLDER=* FILE=*

be saved in a CSV conform file lokking like this

Order#  , Item , Price (US$)
331-445 , Book , 29.95
444-555 , CD-ROM, 15.00

By default a comma (",") is used as separator. This can be modified by changing the entry for "CSVcomma=," in the iMacros settings file (File name: "iim.ini").

If you access the extracted information via the Scripting Interface, you can easily use the separation tags to split the complete dataset.








Page URL http://www.iopus.com/imacros/help/extract_tables.htm