google-spreadsheet-to-json icon indicating copy to clipboard operation
google-spreadsheet-to-json copied to clipboard

Ignore Column but include Hash

Open cfoulston opened this issue 7 years ago • 2 comments

I would like to Hash my objects using an "id" column, but I don't want this "id" column to be part of the json object.

E.g:

Google Sheet: [ID, Name, Type, Image] [63, "My Name", "My Type", "MyImage.png"]

gsjson sheetId data.json -b -c id --ignore-col 1

results in:

{
    "undefined": {
        "name": "My Name",
	"type": "My Type",
	"image": "My Image"
    }
}

Is it possible to still retrieve the hash with the ignore column? which would result in:

{
    "63": {
        "name": "My Name",
	"type": "My Type",
	"image": "My Image"
    }
}

cfoulston avatar May 09 '17 23:05 cfoulston

Thanks for noticing this.

I'm not sure if we should:

  • add a new option to avoid including the hashed field in the object; or
  • allow an ignored column to be used as a hash.

The second seem more obvious to me, what do you think?

bassarisse avatar May 11 '17 13:05 bassarisse

Yes the second option "allow an ignored column to be used as a hash." seems more intuitive to me.

cfoulston avatar May 11 '17 17:05 cfoulston