Jump to content
UBot Underground

Recommended Posts

I scrape a table.

table has xxxxx rows - 7 columns

 

i want my bot to check column 3 to see if a specific number exists

 

if number exists then - save entire row to new table

else if number does not exist then - do nothing

 

 

I just can't seem to get my mind around the code for something like this.

 

Anyone able to share an example?

Link to post
Share on other sites

Guaranteed way to work is.

Set new table position

Set position

Loop table row total

Set a variable to table cell row position column 3

If variable = number

Then save cell 0 cell 1 etc to new table( using set table cell)

Increment new table position

 

Else

 

Increment position

 

Don't have access to pc this weekend if you still can't get this to work by Monday on me.

Link to post
Share on other sites

clear table(&original)
create table from file("ORIGINAL TABLE"&original)
clear list(%new csv)
set(#row, 0, "Global")
loop($table total rows(&original)) {
    if($contains($table cell(&original#row, 3), "NUMBER HERE")) {
        then {
            add item to list(%new csv table"{$table cell(&original#row, 0)},{$table cell(&original#row, 1)},{$table cell(&original#row, 2)},{$table cell(&original#row, 3)},{$table cell(&original#row, 4)},{$table cell(&original#row, 5)},{$table cell(&original#row, 6)}""Delete""Global")
        }
        else {
        }
    }
    increment(#row)
}
save to file("save to new csv file"%new csv table)

  • Like 1
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...