finding old code from 2020-10-19

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2020-10-19 12:16:08 -04:00
parent c11fd878cd
commit a971fe90c7
Signed by: vbatts
GPG Key ID: 10937E57733F1362
1 changed files with 78 additions and 79 deletions

View File

@ -89,8 +89,8 @@ func main() {
// Prints the names and majors of students in a sample spreadsheet:
// https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
spreadsheetId := "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
readRange := "Class Data!A2:E"
spreadsheetId := "1gAn7JyASTCydfC2ZllUx4qpS2hMTd5TWVykq6AVAf-c"
readRange := "Sheet1!A2:E"
resp, err := srv.Spreadsheets.Values.Get(spreadsheetId, readRange).Do()
if err != nil {
log.Fatalf("Unable to retrieve data from sheet: %v", err)
@ -102,8 +102,7 @@ func main() {
fmt.Println("Name, Major:")
for _, row := range resp.Values {
// Print columns A and E, which correspond to indices 0 and 4.
fmt.Printf("%s, %s\n", row[0], row[4])
fmt.Printf("%q\n", row)
}
}
}