Forum Discussion
Andrew500
Aug 04, 2021Copper Contributor
how to create a csv file with saving initial (leading) zeros
I am a user and not an expert. How to make sure that leading (initial) zeros are not lost? Example of a digit (data) in the format 001000001 (Word) Excel I write it in Excel (.xlsx) - text 00100...
Riny_van_Eekelen
Aug 04, 2021Platinum Contributor
Andrew500 When you put an apostrophe before the digits or make sure that the column/range is formatted as text, the leading zeros are preserved in the csv file. You can check that by opening the file in a text editor.
However, when you open the csv file, e.g. by double-clicking it, Excel defaults to numbers and the leading zeros disappear. In stead, open the file from within Excel and a Text Import wizard should come up. Follow the instructions and make sure that in step 3, you select the data type for the column with the "numbers" as Text. Press Finish.