IMPORTDATA Google Sheet CSV on Google Drive

旧时模样 提交于 2021-02-08 11:41:29

问题


So I'm starting to really get into utilizing Google Drive to streamline my many personal projects. One of the things I'd love to do is figure out how to download CSV files onto my Google Drive, and have Google Sheets automatically do an =IMPORTDATA on any new .csv files in a specific directory.

I've come across a number of problems trying to figure this out, but the biggest issue is that putting any kind of file on the Google Drive doesn't give you a link to the file itself, but rather something like such:

https://drive.google.com/a/xxxx/file/x/xxxxxxxxxxxxxxxx/view?usp=sharing

=IMPORTDATA doesn't recognize this as a .csv file. How can I go about doing this?


回答1:


I found the answer from another forum:

Generating a direct download link, as described in this article seems to work fine with the =IMPORTDATA function.

To summarize, you take the SITE_ID string from the sharing link you have:

https://drive.google.com/file/d/FILE_ID/edit?usp=sharing

Using this, you can generate the direct download link for use with the =IMPORTDATA function:

https://drive.google.com/uc?export=download&id=FILE_ID



来源:https://stackoverflow.com/questions/32473639/importdata-google-sheet-csv-on-google-drive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!