finding old code from 2020-10-19
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
c11fd878cd
commit
a971fe90c7
1 changed files with 78 additions and 79 deletions
7
main.go
7
main.go
|
@ -89,8 +89,8 @@ func main() {
|
||||||
|
|
||||||
// Prints the names and majors of students in a sample spreadsheet:
|
// Prints the names and majors of students in a sample spreadsheet:
|
||||||
// https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
|
// https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
|
||||||
spreadsheetId := "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
|
spreadsheetId := "1gAn7JyASTCydfC2ZllUx4qpS2hMTd5TWVykq6AVAf-c"
|
||||||
readRange := "Class Data!A2:E"
|
readRange := "Sheet1!A2:E"
|
||||||
resp, err := srv.Spreadsheets.Values.Get(spreadsheetId, readRange).Do()
|
resp, err := srv.Spreadsheets.Values.Get(spreadsheetId, readRange).Do()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Unable to retrieve data from sheet: %v", err)
|
log.Fatalf("Unable to retrieve data from sheet: %v", err)
|
||||||
|
@ -102,8 +102,7 @@ func main() {
|
||||||
fmt.Println("Name, Major:")
|
fmt.Println("Name, Major:")
|
||||||
for _, row := range resp.Values {
|
for _, row := range resp.Values {
|
||||||
// Print columns A and E, which correspond to indices 0 and 4.
|
// 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue