Forum Discussion

alexhdz2007's avatar
alexhdz2007
Occasional Contributor
6 years ago
Solved

Testcomplete does not input data from CSV in desired format

I am currently having an issue with how testcomplete inputs some of the numerical values from a CSV file. It seems it will not insert them in the format I need them to be in. For example, I will ha...
  • tristaanogre's avatar
    6 years ago

    The problem is that TestComplete will attempt to convert the content of the CSV data field into whatever seems to closely match the data type.  In this case, it sees what looks like numbers and converts them into numeric values, stripping off the extra zeros.

     

    In order to force them to actually keep the xtra zeros, you will need to do one of two things.

     

    1) Easy - Wrap all your values in your CSV file with quotes to indicate they are strings, not numbers.  This will ensure the zeroes are preserved as part of the string.

    2) Advanced (but not hard) - Utilizes a schema.ini file along with your CSV (https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server-2017) to indicate the specific data formats to be used for each column in your file.