shawnbot / tito

Tables In, Tables Out
Creative Commons Zero v1.0 Universal
21 stars 0 forks source link

Add Excel format support #8

Open shawnbot opened 9 years ago

shawnbot commented 9 years ago

Looks like js-xlsx is the most eligible candidate because it does parsing and formatting (and reads from a buffer, which is necessary for stdio). The read and write APIs are synchronous, but we could do something similar to what the HTML parser does and just buffer all the data until the end of the stream.

CLI API for reading:

# just read the first sheet
tito --read excel data.xls
# read the second sheet (1-based index?)
tito --read.format excel --read.sheet 2
# read a named sheet
tito --read.format excel --read.sheet "Sheet Name"

and writing:

# what should the default sheet name be? "Data"?
tito --read csv --write excel
tito --read csv --write.format excel --write.sheet "Sheet Name"