fromxls
Parse Excel files (xls, xlsx, xlsb, xlsm) into records.
Synopsis
bash
recs fromxls [options] <files...>Description
Parse Excel files (xls, xlsx, xlsb, xlsm) into records. By default, reads the first sheet and uses the first row as header names.
Options
| Flag | Description |
|---|---|
--key / -k <keys> | Comma separated list of field names. Overrides header detection. |
--field / -f <keys> | Comma separated list of field names. Overrides header detection. |
--no-header / -n | Do not treat the first row as a header. Fields will be named numerically (0, 1, 2, ...). |
--sheet / -s <name> | Specify a sheet name to read. Defaults to the first sheet. |
--all-sheets | Read all sheets in the workbook, adding a 'sheet' field to each record. |
Examples
Read an Excel file using headers from the first row
bash
recs fromxls data.xlsxRead a specific sheet without headers
bash
recs fromxls --sheet 'Sheet2' --no-header -k name,value data.xlsxRead all sheets
bash
recs fromxls --all-sheets data.xlsx