argasi / google-bigquery

Automatically exported from code.google.com/p/google-bigquery
0 stars 0 forks source link

Leading Zeros get truncated if you download output on a query #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.When i run a query which outputs text which has leading 0, the leading 0 gets 
truncated.

What is the expected output? What do you see instead?
ex - 00064NAMRGR should be the output, but i get 64NAMRGR. If i export t to a 
table and then save it to my cloud space in .txt, it works fine.

What version of the product are you using? On what operating system?

Using win 7

Please provide any additional information below.

Original issue reported on code.google.com by tgf...@motorola.com on 27 Jan 2015 at 4:28

GoogleCodeExporter commented 9 years ago
Just to clarify, you're using the "Download as CSV" button on the UI?

If so, I was unable to reproduce. Could you please attach a job ID for the 
query you ran? Can you also let us know what browser (and version) you're using?

Thanks!

Original comment by jcon...@google.com on 27 Jan 2015 at 5:31

GoogleCodeExporter commented 9 years ago
The job id is as below:

motorola.com:dataservices:job_0khr8kbovy_4ECB5yXcFxHGVmIs

and i am using "Download as CSV" option.

I am using Chrome - Latest Version.

Original comment by tgf...@motorola.com on 27 Jan 2015 at 5:38

GoogleCodeExporter commented 9 years ago
Thanks. I still couldn't repro with Chrome on a Mac. I'll try on a Windows 
machine soon.

Original comment by jcon...@google.com on 27 Jan 2015 at 9:51

GoogleCodeExporter commented 9 years ago
ok....waiting for a resolution....thanks.

Original comment by tgf...@motorola.com on 28 Jan 2015 at 6:11

GoogleCodeExporter commented 9 years ago
Sorry about that! I tried on Chrome/Win8 last night and could not reproduce. I 
tried running this query:

SELECT "000abc"

And downloaded as CSV. The leading 0s were preserved.

Does this happen in all scenarios? Can you give me a super simple repro query 
with explicit instructions on what to click and when in order to reproduce?

Are you reading the downloaded file using a text editor, or some other tool? If 
you're reading it with another tool (Excel?), maybe that tool is stripping the 
zeros off?

Original comment by jcon...@google.com on 29 Jan 2015 at 1:08

GoogleCodeExporter commented 9 years ago
I am using excel.

Original comment by tgf...@motorola.com on 29 Jan 2015 at 3:56

GoogleCodeExporter commented 9 years ago
Can you open the file in a text editor (e.g., Notepad) instead? I'm guessing 
that Excel is stripping off the leading zeros when importing the CSV file.

Original comment by jcon...@google.com on 29 Jan 2015 at 4:38

GoogleCodeExporter commented 9 years ago
yes you are right. When i opened it in notepad the zeros did not get truncated.

The problem is that i have to work on excel and i cannot use notepad as it 
involves complex calculations.

Original comment by tgf...@motorola.com on 29 Jan 2015 at 5:45

GoogleCodeExporter commented 9 years ago
IIRC Excel has lots of options to control how it imports CSV files. I suspect 
you could tweak some of those settings to prevent Excel from misbehaving.

It's also possible it's a display issue in Excel. When you select the cell, 
look at the bar at the top of the screen where you can edit the value in the 
cell. Perhaps the zeros are still there?

Either way, I'm going to close out this bug, since it doesn't appear to be an 
issue in BQ.

Original comment by jcon...@google.com on 29 Jan 2015 at 7:26

GoogleCodeExporter commented 9 years ago
right. thanks.

Original comment by tgf...@motorola.com on 29 Jan 2015 at 7:38

GoogleCodeExporter commented 9 years ago
Also, you can try formatting the cell to use a custom number format or 
displaying as text. See: 
https://support.office.com/en-gb/article/Keep-leading-zeros-in-number-codes-1bf7
b935-36e1-4985-842f-5dfa51f85fe7#

Original comment by bch...@google.com on 29 Jan 2015 at 8:07