Page 1 of 1

Read tab delimited data using csvconnector

Posted: Tue Dec 04, 2012 4:14 am
by newbieR
Hi, I use csvconnector for the tab delimited data file. It reads all data columns as one column. It can read data for space delimited data file though. Is there any previous post about it? How could I split data in tab delimited data file?
I am new to Ranorex.

Thanks for your help!

Re: Read tab delimited data using csvconnector

Posted: Tue Dec 04, 2012 9:23 am
by Support Team
Hello,

It should work if your data in the CSV file is separated by a tab.
Which version of Ranorex do you use? Can you please attach an example file which doesn't work?
Could you please explain the steps you did to load the data.
A tutorial how to use data connectors can be found in the section 'Data Connectors' in our user guide.

Regards,
Bernahrd

Re: Read tab delimited data using csvconnector

Posted: Tue Dec 04, 2012 10:41 am
by newbieR
Hi,
The file extension .txt and tab delimited as attached. I read data using csvConnector from source code as below:
Dim objRow As Ranorex.Core.Data.Row
Dim objOutColCollection As Ranorex.Core.Data.ColumnCollection
Dim objOutRowCollection As Ranorex.Core.Data.RowCollection
Dim ObjCsvConnector As Ranorex.Core.Data.CsvDataConnector =New Ranorex.Core.Data.CsvDataConnector("csvConnector",strBatchFileName,False)
objCsvConnector.SeparatorChar =" "<--It can split correctly for space but does not work for tab
objCsvConnector.LoadData(objOutColCollection,objOutRowCollection)

Dim i As Integer
For Each objRow In objOutRowCollection
MsgBox(Trim(objRow.Item(0).ToString()))
Next

Re: Read tab delimited data using csvconnector

Posted: Tue Dec 04, 2012 12:13 pm
by Support Team
Hello,

Please use the following code to use Tab as separator:
objCsvConnector.SeparatorChar = ControlChars.Tab
Regards,
Markus (T)

Re: Read tab delimited data using csvconnector

Posted: Fri Jan 25, 2013 2:45 am
by newbieR
Hi Markus,

Thank you for your reply. It works.
I have another question that how could I write the value into qcutil.currentrun(hp qc) variable from ranorex?
As Ranorex supports to integrate with QC, I hope you already have an answer.
I googled to find out the related dll file name of qcutil but no luck and not sure qcutil object belongs to which dll file.

Thanks,
newbieR

Re: Read tab delimited data using csvconnector

Posted: Mon Jan 28, 2013 4:02 pm
by Support Team
Hello newbieR,

It is possible to run Ranorex automated tests with HP Quality Center, but unfortunately we do not provide technical support for QC related questions. Maybe some other users here in the forum are able to help you with this issue?

Regards,
Bernhard