Forcing the “Area” column to stay as text
TestComplete uses the OLE DB Text driver under the hood to read CSVs, and by default that driver “guesses” each column’s data type by scanning the first few rows. If it thinks a column is numeric, it will strip leading zeros. You can override that behavior in schema.ini by explicitly declaring each column as Text.
Update your schema.ini, it should look something like this:
[YourFileName.csv]
Format=CSVDelimited
ColNameHeader=True
MaxScanRows=0
; force all three columns to be treated as text
Col1=ID Text
Col2=Area Text
Col3=Name Text
- Format=CSVDelimited tells the driver it’s a comma-delimited file.
- ColNameHeader=True makes the first row your header.
- MaxScanRows=0 forces the driver to scan all rows (not just the first 8) when inferring types.
- ColN=… Text explicitly sets that column to text, preserving leading zeros.
💬 If a response helped you out, don’t forget to Like it! And if it answered your question, mark it as the solution so others can benefit too.