diff options
author | dave <ydrah32@gmail.com> | 2019-01-14 16:05:54 +0000 |
---|---|---|
committer | dave <ydrah32@gmail.com> | 2019-01-14 16:05:54 +0000 |
commit | 43d5fc7145244a306215c7b227fa715ff59cad2a (patch) | |
tree | ae15a4eec1b4a26b55b4218885b18ecd56b669bb | |
parent | 820079e4977f02dfd20cb25f38e412da2ff874bb (diff) |
added --sheet to doc, fixed minor bug
-rwxr-xr-x | src/doc | 10 | ||||
-rw-r--r-- | src/sc-im.1 | 2 | ||||
-rw-r--r-- | src/xlsx.c | 2 |
3 files changed, 12 insertions, 2 deletions
@@ -1388,6 +1388,16 @@ Commands for handling cell content: --txtdelim="," --txtdelim=";" + If you pass a .xlsx file to SC-IM, you can specify which sheet to load + with the --sheet parameter, which can be the name or number of a sheet. + Default value is 1. + + Example: ./sc-im --sheet=dogs file.xlsx + + Some possible values are: + --sheet=3 + --sheet=dogs + ============================================================================== &External scripts& diff --git a/src/sc-im.1 b/src/sc-im.1 index 469b74c..5c26606 100644 --- a/src/sc-im.1 +++ b/src/sc-im.1 @@ -42,7 +42,7 @@ functional similarities with vim text editor. The input file from where to read the spreadsheet. .TP .BR \-\^\-sheet=SHEET -Open SHEET, which can be sheet name or number. Default is 'sheet1'. +Open SHEET when loading xlsx file. Can be sheet name or number. Default is '1'. .SS "Version" .TP .BR \-\^\-version @@ -453,7 +453,7 @@ int open_xlsx(char * fname, char * encoding) { if ( ! found ){ // use sheet number if sheet name does not match name = get_conf_value("sheet"); - int i = strlen(name)-1; + int i = strlen(name); while( --i >= 0 && isdigit(name[i]) > 0 ); name = i < 0 ? "sheet":""; snprintf(namebuf,30,"xl/worksheets/%s%s.xml",name,get_conf_value("sheet")); |