Leading zeros are missing

18,204 views
Skip to first unread message

Leon Carr

unread,
Apr 26, 2014, 11:45:20 PM4/26/14
to memento...@googlegroups.com
I have a library with a field that is set as text, in this field I often input something like "00124" without the quotes; but when I export it I always lose my leading zeros and end up with "124" without the quotes. My leading zeros are a must for this to be useful to me. I am using 2.6.1 with a Pro license. Any help will be appreciated.
Thanks,
Leon.

JohnO

unread,
Apr 27, 2014, 3:25:58 AM4/27/14
to memento...@googlegroups.com
Just tried to duplicate this, exported a text field "00123" (also without quotes).
The resulting CSV file had the leading zeros intact.

Therefore I assume you meant the zeros were lost when you linked to Google Docs.
This does happen, and can be fixed by formatting the relevant column in the Google spreadsheet as text.

Go to the spreadsheet, click on the letter (A, B, etc) above the column you want to format. This will select the whole column.
Click on "Format", then hover over "Number", which will raise a menu panel. At the bottom of the menu panel click on "Plain text".

This won't fix existing data, but subsequent syncs will retain leading zeros.
 

JohnO

unread,
May 1, 2014, 3:09:35 AM5/1/14
to memento...@googlegroups.com
Did this solve the problem?

Leon Carr

unread,
May 4, 2014, 12:52:58 AM5/4/14
to memento...@googlegroups.com
It did solved the problem.
Thanks a million!!
You are awesome. Do you know of a way to setup the database so that when you synchronizing for the first time all of the properties such as field types are transfered to google?

JohnO

unread,
May 5, 2014, 5:57:01 AM5/5/14
to memento...@googlegroups.com
It isn't the database that has to be set up, it's the Google spreadsheet.

Field types are not sent to Google. It guesses the field type from the data it contains.
For example, a field containing only digits will be interpreted as numeric (which is why it drops the leading zeros). 
Dates can be a particular problem, because Google assumes they are in MM/DD/YYYY format. 
If you need DD/MM/YYYY or YYYY/MM/DD you have to format the spreadsheet that way.

Just create your library, put in a single dummy entry (all fields filled) link to Google, then format the spreadsheet.
You can delete the dummy entry, fill the library with real data, and sync when you are satisfied that the spreadsheet is correctly formatted.

Reply all
Reply to author
Forward
0 new messages