Skip to content

Repository files navigation

A command line utility to extract data from Excel files using Excel's COM interface.

Allowed options:

FlagDescription
-h [ --help ]display optional parameter descriptions
-r [ --input-root ] argThe directory to search for input data.
-m [ --map-file ] argThe name (default excel2csv.yaml) of a (yaml format) file
specifying the data to extract from Excel that is to be to output as comma separated values.
See [Map file syntax] for details.
-p [ --map-params ] argThe name of a file containing a (yaml format) list of parameter values from which combinations are constructed.
See [Parameter file syntax] for details.

Map file syntax

Each element in the input section nominates the file path pattern and the data to extract.

Example 1: Extract the Transactions sheet from all selected workbooks

Input:
Path: "2[0-9]06 Personal Expenses.xls"Sheet: Transactions
---

Example 2: Extract a named cell range from all selected workbooks

Input:
Path: "2[0-9]06 Personal Expenses.xls"Name: Sum_of_Amounts
---

Example 3: Extract the Transactions sheet from all selected workbooks using all combinations of Location and NamePrefix

ParameterCombinations:
- Name: NamePrefixValue: [19, 20]
- Name: LocationValue: [Family Trust, Super Fund]Parameters:
- &NamePrefix xxxxx- &Location xxxxxInput:
Path: [*Location, "*/", *NamePrefix, " Personal Expenses.xls"]Sheet: Transactions
---

Parameter file syntax

Each list element specifies a variable name and list of value. Output is generated for each combination in the cross product of variable values.

Example 1:

- Name: NamePrefixValue: [19, 20]
- Name: LocationValue: [Family Trust, Super Fund]
---

Example 2:

- Name: NamePrefixValue: [ 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 ]
---

The list of parameter values may alternatively be provided in the 'ParameterCombinations' section of the map file.

About

Extract data from Excel using its COM Interface

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages