Preserve leading zeros when outputing text to a delimited text file

How do I preserve leading zeros when outputting numbers in text columns to a delimited text file?

EasyMorph shows the leading zero, but when exported the CSV column format is scientific and leading zeros suppressed.

Hi Robert and welcome to the Community!

Can you provide an example (value in EasyMorph and the result value in the CSV file)?

I’d like to know this too. In my case in EasyMorph i have a column that shows the date in the format “MM.yyyy”. This column is all text as shown in the top ribbon and because all the values inside of the fields is to the left (numbers would be to the right).

  1. If i export this to a csv i should get “MM.yyyy” but if i open the csv in Excel of Tableau Desktop for the values where MM do not start with a 0 (eg: 11.2022) all is fine, but i for the ones that do start with a 0 i get M.2022 (eg: 3.2022).
  2. If i export it to excel directly this does not happen.

Bonus: If i now open the exported csv from 1) into EasyMorph again, the months that start with 0 are defined as numbers and the other ones are defined as text. If i now convert the whole column to text (again) and export it (again), same issue and pointed out in 1)

When EasyMorph exports to CSV the dataset below…

image

…this is the output:

"09.2023"
"10.2023"

The leading zero is preserved. Why does Excel or Tableau import such CSV and drop the leading zero - that’s a question for the respective vendors.

If you need EasyMorph to produce a specific CSV output that Excel or Tableau can handle as you need them to, please provide an example.