user1296114
user1296114

Reputation: 99

Issues with converting google spreadsheets to csv

Saving a google spreadsheet to my server as a CSV is so strange i don't know what to do!

If i open this file : https://docs.google.com/spreadsheets/d/1Tb65rlX7y1XfiBNb4N4oIwJuM15I4cHtIQj1NHpUeRs/edit?usp=sharing

And download the CSV the file is ok.

But i want to be able for my server to download that google spreadsheet as a CSV file i use this link : https://spreadsheets.google.com/a/the-pirate-way.com/tq?tqx=out:csv&tq&gid=1&key=1Tb65rlX7y1XfiBNb4N4oIwJuM15I4cHtIQj1NHpUeRs

So simple right? That those CSV files should be the same right? I mean its the same google spreadsheets its coming from!

But they are NOT the same and heaps of things are missing on the CSV my server downloads, or if you download it using the second link!

Upvotes: 1

Views: 2441

Answers (1)

CodeFreak
CodeFreak

Reputation: 110

From the research I have done, when saving the CSV file, some data is missing due to the fact that it is being converted into a different type due to the way you open or read the file. To exaplin further what I mean, I feel like this link will be helpful:

https://support.3dcart.com/knowledgebase/article/View/619/7/why-does-my-exported- 
csv-data-get-converted-to-weird-formats

For example, when exporting the customer records CSV file, and a customer's phone number is listed as 8008286650; upon opening up the file in Excel, you'll have the number shown as 8.01E+09 or something similar. The section that I would think would be helpful to you in this article is the section titled, "Opening the CSV file in a spreadsheet". In short summary, it says:

To work around this problem, the best thing is to not open the file directly into the spreadsheet program, but rather import the text file (CSV) data into the spreadsheet program while it is already open. During the import of text data, your spreadsheet program will give you the option to have the spreadsheet program format the data as "text" so that mathematical formatting is not used on your CSV file's numbers. Hope this helps!

Upvotes: 1

Related Questions