Jump to content
UBot Underground

Just want one column from table


Recommended Posts

Off the top of my head I would say scrape the whole table and then save to temp file.

 

Read that file into a list

Loop for the total of the list you just read in

Add to list, use list item to add only the column you want to the new list

Save that file

 

Not tested but think it should work!

Link to post
Share on other sites

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

Link to post
Share on other sites

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 ;)

  • Like 1
Link to post
Share on other sites

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 ;)

Link to post
Share on other sites

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 B).

 

Cheers.

Link to post
Share on other sites

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

Link to post
Share on other sites

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 Row

2. 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.

  • Like 1
Link to post
Share on other sites

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 Row

2. 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.

Link to post
Share on other sites
  • 3 weeks later...

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...