你好
- User
你好
- Assistant
你好!我是AI语言模型,有什么可以为您服务的?
- User
我使用繁體中文
- Assistant
謝謝您的指示,我們可以用繁體中文進行交流。請問您有什麼問題或需要幫忙的事情嗎?
- User
我想用google試算表讀取google雲端中的檔案,並在欄位顯示檔案名稱、修改日期還有檔案路,該怎麼操作?
- Assistant
您可以遵循以下步驟在 Google 試算表中读取 Google 雲端硬盘中的文件的文件名稱、修改日期和文件路徑:
-
在 Google 試算表中新建一個工作表。
-
在第一行分别输入标题 “文件名称”,“修改日期”和“文件路径”。
-
在第二行输入以下公式,从 Google 雲端硬盘中列出有关信息:
=QUERY( IFERROR( {DriveApp.getFilesByName("*"), DriveApp.getFoldersByName("*")} ), "select * where Col1 is not null", 1)- 在第一列会显示文件名,添加指定行用的公式:
=IFERROR(HYPERLINK(DriveApp.getFileById(MID(A2,FIND("id=",A2)+3,26)).getUrl(),DriveApp.getFileById(MID(A2,FIND("id=",A2)+3,26)).getName()),"")- 在第二列显示修改日期,添加指定行用的公式:
=IFERROR(DATEVALUE(LEFT(RIGHT(A2,LEN(A2)-FIND(" ",""&A2)+1),FIND(",",RIGHT(A2,LEN(A2)-FIND(" ",""&A2)+1))-2)),"")- 在第三列显示文件路径,添加指定行用的公式:
=IFERROR(JOIN(" > ",QUERY(SPLIT((IF(MID(A2,FIND(",",A2)+1,1)=" ",MID(A2,FIND("item=",A2)+5,21),MID(A2,FIND("path=",A2)+5,100)),"/"),),"select * where Col1 <>'' "))- 最后,您可以根据需要格式化表格,以使其看起来更漂亮和易于使用。
以上步驟基於Google apps script工具,需要在Google試算表裡啟用script,您可以遵循以下步驟啟用範例腳本:
-
打开您要工作的 Google 試算表,
-
依次点击“工具”>“編輯腳本”
-
在腳本編輯器中,選擇"新建",並粘貼以上指定行的公式。
-
其次,請點擊編輯器窗口上方的“儲存”按鈕,以保存這個腳本。
此時,您應該可以在 Google 試算表中看到新的工作表,並在其中列出 Google 雲端硬盘中的檔案名稱、修改日期和檔案路径。
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- gpt-4-0314Compare side by side →
- gpt-3.5-turbo-0301Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-3.5-turbo-0301Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-3.5-turbo-0301Compare side by side →
- gpt-3.5-turbo-0301Compare side by side →
- gpt-4-0314Compare side by side →
- gpt-3.5-turbo-0301Compare side by side →