Jump to content
UBot Underground

Creating usable varialbe from external file?


Recommended Posts

How do i use external file content in a variable ? I'm currently using create "table from file" then "table cell" to find the correct table cell, but then i want to use it in a if or conditional statement.

 

I.E if my table cell contains the number 2, i want to be able to say if (table cell number < 5) then do whatever, but it doesn't seem to recognize it as number. The same happens with strings...if my cell contains the word 'approved', and i say if(table cell = approved). then it fails to work. How do i get the content to the right format?

 

All i'm trying to do is run different sub node depending on what the content of a file cell is...so if theres another way that would be spot on too.

 

cheers :)

Link to post
Share on other sites

How do i use external file content in a variable ? I'm currently using create "table from file" then "table cell" to find the correct table cell, but then i want to use it in a if or conditional statement.

 

I.E if my table cell contains the number 2, i want to be able to say if (table cell number < 5) then do whatever, but it doesn't seem to recognize it as number. The same happens with strings...if my cell contains the word 'approved', and i say if(table cell = approved). then it fails to work. How do i get the content to the right format?

 

All i'm trying to do is run different sub node depending on what the content of a file cell is...so if theres another way that would be spot on too.

 

cheers :)

 

Hi ttmw,

 

A possible solution is to use a counter i.e. a variable to 1 and use a while loop with evaluate quatifier counter < 5 = do something in the while loop and then in the while loop increment the counter.

 

Hope this will help,

 

Shoot me a question if you have..

 

Cheers!!

 

Praney :)

  • Like 1
Link to post
Share on other sites

Thanks for the reply Praney, if i understand it right it's not really what i was looking for. I can already cycle through the whole list by using $table_total_rows.

 

What i need to do is use the data from my CSV withing the qualifiers list or conditional statements. At the moment i cant seem to.

Link to post
Share on other sites

Thanks for the reply Praney, if i understand it right it's not really what i was looking for. I can already cycle through the whole list by using $table_total_rows.

 

What i need to do is use the data from my CSV withing the qualifiers list or conditional statements. At the moment i cant seem to.

 

 

I think I understand what you are trying to do. You are trying to have the if statement say:

 

If table cell row 0 column 0 is > 1 then navigate to bing.com or whatever

 

Is that right?

 

If so, it should be working. maybe it is just a matter of how the script is structured. Try playing around with the script I attached. Put in your CSV file in the UI open file at the top. I put a UI text box at the top with a variable, which I placed into the Value box in the evaluate command. Try it out, let me know if that's what you're looking for. If not, we'll see what else we can try.

 

tables evaluated.ubot

Link to post
Share on other sites

Yes that's exactly what i was looking for. After playing around it seems to only happen when the column is set to 0, its like it adds a line break before the string(in the output)...

 

Not sure if it's a bug or what, but works fine with any value above 0.

Link to post
Share on other sites

Yes that's exactly what i was looking for. After playing around it seems to only happen when the column is set to 0, its like it adds a line break before the string(in the output)...

 

Not sure if it's a bug or what, but works fine with any value above 0.

 

 

You can put up a small script demonstrating that and I will take a look at it.

Link to post
Share on other sites

If you just use your script but change the column it references to in the CSV file to '0' instead of '1' and try and use it in a conditional statement. On my computer running in Virtual machine it fails to work.

 

When i output the string from any of the CSV cells in the first column it seems to put a line break before it.

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