Skip to content

Command Data From Google Docs Sheets Storage

Ross Scroggs edited this page Mar 13, 2023 · 1 revision

Command data from Google Docs, Sheets and Cloud Storage

Introduction

Google Sheets can be used in gam csv ... commands.

Google Docs and Sheets can be used to specify collections of data.

Google Docs and Drive Files can be used to specify notes, messages and signatures.

Definitions

Read data from a Google Doc or Drive File

<UserGoogleDoc> ::=
        <EmailAddress> <DriveFileIDEntity>|<DriveFileNameEntity>|(<SharedDriveEntity> <SharedDriveFileNameEntity>)
  • <EmailAddress> - The email address of a user with at least read access to the document

Use one of the following to specify the file:

  • <DriveFileIDEntity> - The ID of the file on a Drive or Shared Drive
  • <DriveFileNameEntity> - The name of the file
  • <SharedDriveEntity> <SharedDriveFileNameEntity> - A Shared Drive and the name of the file on that drive

Plain Text

Interpret a Google Doc as plain text or read a Drive file with MIME type text/plain.

gdoc <UserGoogleDoc>

HTML

Read a Drive file with MIME type text/html.

ghtml <UserGoogleDoc>

Read data from a Google Sheet

<SheetEntity> ::= <String>|id:<Number>

<UserGoogleSheet> ::=
        <EmailAddress> <DriveFileIDEntity>|<DriveFileNameEntity>|(<SharedDriveEntity> <SharedDriveFileNameEntity>) <SheetEntity>
  • <EmailAddress> - The email address of a user with at least read access to the document

Use one of the following to specify the file:

  • <DriveFileIDEntity> - The ID of the file on a Drive or Shared Drive
  • <DriveFileNameEntity> - The name of the file
  • <SharedDriveEntity> <SharedDriveFileNameEntity> - A Shared Drive and the name of the file on that drive

If a file name is specified, it must resolve to a single file ID; otherwise an error is generated.

If a Shared Drive name is specified, it must resolve to a single Shared Drive ID; otherwise an error is generated.

Select a sheet/tab from the Google Sheet with its ID or name; it is verified to exist within the Google Sheet.

Example:

gam csv gsheet [email protected] <DriveFileIDEntity> "Sheet 1" gam create user firstname "~FirstName" lastname "~lastName" email "~email"

Read data from a Google Cloud Storage File

<StorageBucketName> ::= <String>
<StorageObjectName> ::= <String>
<StorageBucketObjectName> ::=
        https://storage.cloud.google.com/<StorageBucketName>/<StorageObjectName>|
        https://storage.googleapis.com/<StorageBucketName>/<StorageObjectName>|
        gs://<StorageBucketName>/<StorageObjectName>|
        <StorageBucketName>/<StorageObjectName>

CSV

Read a Google Cloud Storage file with contentType text/csv.

gcscsv <StorageBucketObjectName>

Plain Text

Read a Google Cloud Storage file with contentType text/plain.

gcsdoc <StorageBucketObjectName>

HTML

Read a Google Cloud Storage file with contentType text/html.

gcshtml <StorageBucketObjectName>

Update History

Installation

Configuration

Notes and Information

Definitions

Command Processing

Collections

Client Access

Special Service Account Access

Service Account Access

Clone this wiki locally