bassarisse / google-spreadsheet-to-json

Simple tool to export Google Spreadsheets to JSON files, though Node API or CLI
The Unlicense
134 stars 33 forks source link

Ignore Column but include Hash #13

Open cfoulston opened 7 years ago

cfoulston commented 7 years ago

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"
    }
}
bassarisse commented 7 years ago

Thanks for noticing this.

I'm not sure if we should:

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

cfoulston commented 7 years ago

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