export: now exports header for tabular files by default and added option

to only export specific columns
This commit is contained in:
mercierc
2021-07-22 09:23:18 +12:00
parent ce7ae4ac55
commit 99c1cd60d6
4 changed files with 67 additions and 41 deletions

View File

@ -137,10 +137,10 @@ def __addImportInputOption(optionManager):
def __addTabularOption(optionManager):
group = optionManager.add_argument_group("Input and output format options for tabular files")
group.add_argument('--header',
action="store_true", dest="obi:header",
default=False,
help="First line of tabular file contains column names")
group.add_argument('--no-header',
action="store_false", dest="obi:header",
default=True,
help="Don't print the header (first line with column names")
group.add_argument('--sep',
action="store", dest="obi:sep",
@ -297,6 +297,12 @@ def __addExportOutputOption(optionManager):
const=b'tabular',
help="Output file is in tabular format")
group.add_argument('--only-keys',
action="append", dest="obi:only_keys",
type=str,
default=[],
help="Only export the given keys (columns).")
group.add_argument('--print-na',
action="store_true", dest="obi:printna",
default=False,