Tip to handle zero prefixed values, when converting an array to CSV.

Suppose we have an item with the name “00328ac“, and we want to add this information to a CSV file as a column value. By default, when we open this CSV file in Excel, the leading zeros in the item name will be removed, and the value will be displayed as “328ac“. To ensure that the Excel sheet displays the item name exactly as it is, you can add a tab character (“\t“) before setting the value in the CSV file. This will preserve the leading zeros in the item name.

Example: Obj.[variable Name] = [variable Name] +”\t”.

Leave a comment

Your email address will not be published. Required fields are marked *