How to get specific row from DDT.CSVDriver
Hi all,
I have the csv data file like this have 10 rows
username,password
def,ids
abc,def
efc,pass
....
....
And I use DDT.CSVDriver to read that file and store it in a variable like this.
var testData = DDT.CSVDriver(path)
And now I have a case that wants to get a specific row in the testData variable. for example, I want to the row 2,6,7, or rows start from 4 to 8. How Testcomplete's methods support?
Thanks,
DDT.CSVDriver is meant for looping through all the rows in the csv file in sequential order. If you want to pick out particular rows, then you'll have to check your row number in each iteration of the loop and then do something on the ones you want but skip the others.
https://support.smartbear.com/testcomplete/docs/reference/program-objects/ddt/csvdriver.html
If you're using a table variable, then you can reference each item in a row by row number and column name. See the Using Table Variables section here>
https://support.smartbear.com/testcomplete/docs/testing-with/variables/data-types/table.html