1

I'm importing a text file with some columns being 000000, 0000, 000000000. Google Docs converts them all to 0 - treating them as numbers. How do I make the columns contains exactly the string that was in the text file?

3

The column data 000000, etc. is being seen as a number and consequently the leading zeros are being removed. Unfortunately, AFAIK, there is no way in Spreadsheet to format a number with leading zeros. In the old Google Spreadsheet there was no way to format a number with leading zeros. However, as mentioned by pnuts in comments, in the new Google Sheets you can specify a "Custom number format..." under Format > Number > More Formats. Specifying a format string such as 0000 will format a number to 4 digits with leading zeros. The formatting would need to be done after the data is imported.

However, if these data values are intended to be strings, then you will need to modify the source data by prefixing the data values with ' (an apostrophe) in order to force a string value. For example:

'000000,'0000,'000000000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.