Cornerstone 0 Posted April 1, 2011 Report Share Posted April 1, 2011 I am reading in parameters into my bot by creating a table from a csv filecurrently i have a ui box to tell which row to get the data from and the location of the file If I tell what row to use it fills in all the fields on the various sites it visitsThe problem with this is that I have to open up the csv file first to see what row the information is on Each one of my clients has a numberic acount number like 14732 etcWhat I want to do is put in the account number instead of the row number Is there a way to search the csv file and it know which row the data is on using the contains command Thanks in advance Quote Link to post Share on other sites
Anonym 53 Posted April 1, 2011 Report Share Posted April 1, 2011 I am currently struggling with a kind of similar problem and I was looking here in the forums for a method that can be used to identify on what row in a UI listbox that I have clicked in order to get an index instead of searching for it. Anyway, what I have done is that I have a CSV file where each row contains a key-value pair, these are read into a table. I have a UI listbox that contains the keys (which are strings, e.g. "Wordpress", "Pligg" etc). In order to find the value part of the key-value pair, I am looping through my table and compare the key with what I am looking for. The problem is that I don't seem to always find the value part so I thought that there "should be" an index that I can use to get the info on what row of the UI box that has been clicked. In your case, I guess you should be able to step through the table containing the data you are looking for and compare the key with the column where you have your key. When you have found it you get the row and should be able to get the relevant data out from that row. If you have loads of rows in your table, then this probably take ages to find since the search is sequential. Then again, it's probably not likely that you have massive amounts of rows in a listbox. Quote Link to post Share on other sites
JohnB 255 Posted April 1, 2011 Report Share Posted April 1, 2011 Yes, loop through the column containing the account numbers by setting two variables (#row and #column) to 0. You will be searching table cells (not rows) for your desired account number. When it finds it it will already have the appropriate row stored in the variable (since you are incrementing the #row variable on each cycle). It;s a pretty simple process. Let me know if you need an example. John Quote Link to post Share on other sites
Praney Behl 314 Posted April 1, 2011 Report Share Posted April 1, 2011 It's easy to accomplish that. All you need to do find out is what column of the table it resides. Now run a loop starting from 0 to total table rows. Put an If condition to check if the table cell content matches the UI input. If true then run another loop running on the row as that row and starting column 0 to total cells and make it do what you want to. Praney Quote Link to post Share on other sites
Cornerstone 0 Posted April 4, 2011 Author Report Share Posted April 4, 2011 All my account numbers will reside in column 0Thanks it makes more sense now. I will give it a try and let you guys know Quote Link to post Share on other sites
Praney Behl 314 Posted April 5, 2011 Report Share Posted April 5, 2011 So are you still stuck, or did you get through? Quote Link to post Share on other sites
UBotBuddy 331 Posted April 5, 2011 Report Share Posted April 5, 2011 Staying consistent with how you layout your columns is key. Also, not too many knew you could do this but you can use "$text length" to test the length of the cell itself. If it is Zero then maybe you need to add something or whatever your you are testing for. Lots of flexibility using this method with tables. 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.