'Google Apps Script - Programmatically Access Script ID From File ID [duplicate]
I'm using Google Apps Script to make many copies of spreadsheets that have embedded code inside of them. I want to be able to make a log of the Script IDs of each copy of the spreadsheet, without having to manually go into each spreadsheet, then script file, and copy the script ID. I know that within a script, I can use ScriptApp.getScriptId(), but of course that won't work from a standalone script only referencing the copy of the file.
tl;dr: if I have a script embedded in a Google Sheet, and I have the File ID for the Google Sheet, can I programmatically access the Script ID using Apps Script?
Solution 1:[1]
Maybe try a python csv library called pandas.
I found a tutorial that shows you how to use custom delimiters.
pandas.read_csv(filepath_or_buffer, sep=', ', delimiter=None, header='infer', names=None, index_col=None, ....)
I think this line will be most useful to you.
Solution 2:[2]
I haven't had a chance to test this but your loop on all of the elements looks incorrect. Try:
with open("data.csv", "r") as data:
for line in data:
for element in line.split('`'):
print(element)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Paul595 |
| Solution 2 | Jeff Siver |
