Read tab delimited data using csvconnector

Ranorex Spy, Recorder, and Studio.
newbieR
Posts: 3
Joined: Tue Dec 04, 2012 4:00 am

Read tab delimited data using csvconnector

Post by newbieR » Tue Dec 04, 2012 4:14 am

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!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Read tab delimited data using csvconnector

Post by Support Team » Tue Dec 04, 2012 9:23 am

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
.
Image

newbieR
Posts: 3
Joined: Tue Dec 04, 2012 4:00 am

Re: Read tab delimited data using csvconnector

Post by newbieR » Tue Dec 04, 2012 10:41 am

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
Attachments
case_tracking_details.txt
(1.67 KiB) Downloaded 196 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Read tab delimited data using csvconnector

Post by Support Team » Tue Dec 04, 2012 12:13 pm

Hello,

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

newbieR
Posts: 3
Joined: Tue Dec 04, 2012 4:00 am

Re: Read tab delimited data using csvconnector

Post by newbieR » Fri Jan 25, 2013 2:45 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Read tab delimited data using csvconnector

Post by Support Team » Mon Jan 28, 2013 4:02 pm

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
.
Image