ttmw 0 Posted August 22, 2010 Report Share Posted August 22, 2010 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 Quote Link to post Share on other sites
Praney Behl 314 Posted August 22, 2010 Report Share Posted August 22, 2010 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 1 Quote Link to post Share on other sites
ttmw 0 Posted August 22, 2010 Author Report Share Posted August 22, 2010 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. Quote Link to post Share on other sites
MiriamMB 63 Posted August 22, 2010 Report Share Posted August 22, 2010 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 Quote Link to post Share on other sites
ttmw 0 Posted August 23, 2010 Author Report Share Posted August 23, 2010 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. Quote Link to post Share on other sites
MiriamMB 63 Posted August 23, 2010 Report Share Posted August 23, 2010 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. Quote Link to post Share on other sites
ttmw 0 Posted August 24, 2010 Author Report Share Posted August 24, 2010 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. 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.