Ask a Question

import values with dots

SOLVED
giovanni_favara
Contributor

import values with dots

Hello,

I want to import a csv file. In this file there is a colum with dates. The date format have dots to separe the information in the date (e.g. "05.05.2018"). This date format will be used in Germany.

 

During the import from csv file into a "Data-Driven Loop" I can see that the double quoted string "05.05.2018" will be transformed into a number 5052018.

 

Why TestComplet do this? For me is that a bug.

 

I tried to escape the dots with backsledge, but doesn't work well. Have somebody a workaround?

 

Best regards

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
AlexKaras
Community Hero

Re: import values with dots

Hi Giovanni,

 

Can you post here the problematic code and its output?

I tried a simplest keyword test with your sample cvs file and got expected result in the log:

 

Test1.png

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

giovanni_favara
Contributor

Re: import values with dots

Hello Alex,

thx for your support. I have found a solution.

 

I had made a mistake with the schema ini file. I forget to unceck the option "Use these custom parameters instead of the system settings:".

 

With schema file now the import works well.

CTempGFATestdatenestCompleteSchema.pngData-Driven Loop_2018-04-25_10-36-52.png

 

I think that with you the import behaves differently, because my Windows configuration is different regarding country settings.

 

Regards

Giovanni

View solution in original post

6 REPLIES 6
cunderw
Community Hero

Re: import values with dots

What version of Test Complete are you using? Are you doing anything else different? Using your example I was able to see the dots and log them as well. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
AlexKaras
Community Hero

Re: import values with dots

Hi,

 

> For me is that a bug.

CSV file is processed not by TestComplete but by a driver that provides processed data to TestComplete. Behaviour of the driver can be influenced by the locale settings of the given machine. For the maximum reliability and portability of the import I would recommend to create a schema.ini file and specify required settings there.

https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server...

https://stackoverflow.com/questions/12259562/how-can-i-create-schema-ini-file-i-need-to-export-my-cs...

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
giovanni_favara
Contributor

Re: import values with dots

I use the latest version 12.5.4142.7.

giovanni_favara
Contributor

Re: import values with dots

Hi AlexKaras,

if I don't use a text qualifier then you have right. But I use text qualifier and choice the correct text qualifier in the wizzard. In this case, I expect the date to be treated as a string.

 

I have followed your advice and generated a schema file. The CSV file I have again exported without double quote and again performed the import. Result: The schema file will be is ignored.

 

Regards

Giovanni

AlexKaras
Community Hero

Re: import values with dots

Hi Giovanni,

 

Can you post here the problematic code and its output?

I tried a simplest keyword test with your sample cvs file and got expected result in the log:

 

Test1.png

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

giovanni_favara
Contributor

Re: import values with dots

Hello Alex,

thx for your support. I have found a solution.

 

I had made a mistake with the schema ini file. I forget to unceck the option "Use these custom parameters instead of the system settings:".

 

With schema file now the import works well.

CTempGFATestdatenestCompleteSchema.pngData-Driven Loop_2018-04-25_10-36-52.png

 

I think that with you the import behaves differently, because my Windows configuration is different regarding country settings.

 

Regards

Giovanni

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: