mcapodici 0 Posted January 5, 2012 Report Share Posted January 5, 2012 Hi I am using the pro version with the scrape table option I want to extract a single column from this and save it to a file. What is the best way to do this? Thanks Martin Quote Link to post Share on other sites
malefic 48 Posted January 5, 2012 Report Share Posted January 5, 2012 Off the top of my head I would say scrape the whole table and then save to temp file. Read that file into a listLoop for the total of the list you just read inAdd to list, use list item to add only the column you want to the new listSave that file Not tested but think it should work! Quote Link to post Share on other sites
JohnB 255 Posted January 5, 2012 Report Share Posted January 5, 2012 I would scrape the table as suggested and then follow up with a loop. In that loop use an "add item to list" (table cell) from the column you want...then save the list to a file. John Quote Link to post Share on other sites
Praney Behl 314 Posted January 5, 2012 Report Share Posted January 5, 2012 So I guess you have scraped the table already. Now you know the position of this column that you want. You need to run a loop through it and then save it in a table. Here are 2 examples on how you can do it: P.S. Assuming the table name is : 'your_table_name' and column you wish to extract is the first column, hence '0'. Example 1. Without using list: set(#pos, 0, "Global") set(#data, $nothing, "Global") loop while($comparison(#pos, "<", $table total rows(&your_table_name))) { set(#data, "{#data} {$table cell(&your_table_name, #pos, 0)}", "Global") increment(#pos) } save to file("{$special folder("Desktop")}\\data.txt", #data) Example 2. Using list: set(#pos, 0, "Global") clear list(%data) loop while($comparison(#pos, "<", $table total rows(&your_table_name))) { add item to list(%data, $table cell(&your_table_name, #pos, 0), "Delete", "Global") increment(#pos) } save to file("{$special folder("Desktop")}\\data.txt", %data) Hope it helps. Cheers! Praney 1 Quote Link to post Share on other sites
Praney Behl 314 Posted January 5, 2012 Report Share Posted January 5, 2012 I would scrape the table as suggested and then follow up with a loop. In that loop use an "add item to list" (table cell) from the column you want...then save the list to a file. John LOL you beat me by minute as I was writing the code... Haha Good stuff mate Quote Link to post Share on other sites
theninjamanz 29 Posted January 5, 2012 Report Share Posted January 5, 2012 I tried to do this earlier. Scraped an attribute with a wild card which pulled back a list of titles. Then I added that list ot a table as a column row 0, column 0. Then I scraped another item on the page and added that to another list, and then tried to add that list to the table in column 1, row 0. Any idea why what happened when I saved off the table why I got one set of items after another (IE it was just a long list of list A and list . Cheers. Quote Link to post Share on other sites
JohnB 255 Posted January 5, 2012 Report Share Posted January 5, 2012 The only thing that comes to mind is make sure you didn't mix up the column and row. It's one of the commands I use frequently and it works very well, so if you want to share your code, I'll be happy to have a look at it. Feel free to PM me if you want to keep it private. John Quote Link to post Share on other sites
UBotBuddy 331 Posted January 5, 2012 Report Share Posted January 5, 2012 I have suggested several times in the Enhancement area that we need (at the very least) two additional nodes. 1. Add to List from Table Row2. Add to List from Table Column I would suggest throwing it back to the Enhancement area again. That's all we can do except write more code. 1 Quote Link to post Share on other sites
Guest michelsmith Posted January 5, 2012 Report Share Posted January 5, 2012 Really it's very helpful information thanks for sharing Quote Link to post Share on other sites
adamv 0 Posted January 6, 2012 Report Share Posted January 6, 2012 I have suggested several times in the Enhancement area that we need (at the very least) two additional nodes. 1. Add to List from Table Row2. Add to List from Table Column I would suggest throwing it back to the Enhancement area again. That's all we can do except write more code. I would love to see those additions. It would be so much easier than doing it the way mentioned above and I have found myself wishing I could create a list from a table column many times. Quote Link to post Share on other sites
junk 0 Posted January 23, 2012 Report Share Posted January 23, 2012 Through running a loop you can do it and save it in a table. In addition to this you can add to list from the table and add to list from the table column. It will be helpful for you.Thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.