Page 1 of 1

how to pass commas in test dat

Posted: Thu Jan 21, 2016 11:40 am
by Shahnaz
hi
I am using CSV connector for getting test data from my csv sheet.
I want to pass commas in my test data. For eg: "Select firstname,Lastname,userid from Table" in csv file
It is looking fine in csv file, but in ranorex data sources it is splitting the string as
Select firstname Lastname Userid from Table

Cant we have any text qualifier in ranorex as we have in excel and openoffice for passing commas in test data.
Thanks in advance

Re: how to pass commas in test dat

Posted: Thu Jan 21, 2016 1:02 pm
by odklizec
Hi,

CSV stand for comma-separated values. So if there is "," (comma) defined between two strings, it's always used as a value separator. If you would open such CSV file in Excel, it will also separate these values into individual columns, containing "Select firstname" "Lastname" and "userid from Table" values.

If I understand you right, you want entire string in single column and not separated in three individual columns??
So the solution is to enclose entire string in double quotes, like this:
"Select firstname,Lastname,userid from Table"
And this is how it should look, if you want CSV with multiple columns:
"Select firstname,Lastname,userid from Table", column2, column3, "column4,column4-1"
Where Ranorex should split the file into 4 separate columns. Hope this helps?