Posted: 5 Mar 2017 10:33 EST Last activity: 12 Sep 2019 5:27 EDT
CSV file containing leading zeros
Can Excel connector open a CSV file without losing leading zeros?
When the CSV has data such as "0000001", then Excel launched by the Robot displays it as "1". If you use Excel application manually, then you can choose various options. But what about opening it with Robot's Excel connector?
It seems that there is no parameters in Excel object's Properties window or in Open/Start methods' parameters to specify this kind of thing.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Create a script container to hold the ImportCSV script. Add the following references:
Add this script (see attachments for full script code). Make sure to update the line where the columnDataTypes values are set to match your import file:
script continued in the second graphic ...
With a little more work you can add the columnDataTypes as an input parameter to the script. Setting the columnDataType = 2 for the column with the leading zeros will preserve the leading zeros in the spreadsheet. Hope this helps.
Posted: 4 years ago
Updated: 1 year ago
Posted: 10 Mar 2017 3:53 EST Updated: 12 Sep 2019 5:27 EDT