Skip to content

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

FlagDescription
--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 / -nDo 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-sheetsRead 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.xlsx

Read a specific sheet without headers

bash
recs fromxls --sheet 'Sheet2' --no-header -k name,value data.xlsx

Read all sheets

bash
recs fromxls --all-sheets data.xlsx

See Also

Released under the MIT License.