diff --git a/tabtotext.py b/tabtotext.py index 85eca05..3a09a1e 100755 --- a/tabtotext.py +++ b/tabtotext.py @@ -2983,11 +2983,13 @@ def tabFileToPrintWith(filename: str, fileformat: str, output: str = NIX, fmt: s help="override cell padding for format") cmdline.add_option("-t", "--tabulator", metavar="C", default=None, help="override tabulator for format") - cmdline.add_option("-T", "--notab", action="store_true", default=False, + cmdline.add_option("-T", "--asciitab", action="store_true", default=False, + help="use ascii HT tabulator (csv,md,tab,wide)") + cmdline.add_option("-N", "--notab", action="store_true", default=False, help="do not use tabulator (csv,md,tab,wide)") cmdline.add_option("-P", "--nopadding", action="store_true", default=False, help="do not use padding (csv,md,tab,wide,html)") - cmdline.add_option("-N", "--noheaders", action="store_true", default=False, + cmdline.add_option("-D", "--noheaders", action="store_true", default=False, help="do not print headers (csv,md,tab,wide)") cmdline.add_option("-U", "--unique", action="store_true", default=False, help="remove same lines in sorted list (csv,md,...)") @@ -3011,7 +3013,7 @@ def tabFileToPrintWith(filename: str, fileformat: str, output: str = NIX, fmt: s selected = opt.labels minwidth = int(opt.minwidth) padding = opt.padding if not opt.nopadding else "" - tab = opt.tabulator if not opt.notab else "" + tab = "\t" if opt.asciitab else opt.tabulator if not opt.notab else "" tabtext = tabtextfile(filename, opt.inputformat) done = print_tabtotext(opt.output, tabtext.data, tabtext.headers, selected, datedelim=opt.datedelim, tab=tab, padding=padding, diff --git a/tabxlsx.py b/tabxlsx.py index 7d9e980..3e7a2e6 100755 --- a/tabxlsx.py +++ b/tabxlsx.py @@ -1155,11 +1155,13 @@ def extension(filename: str) -> Optional[str]: help="override cell padding for format") cmdline.add_option("-t", "--tabulator", metavar="C", default=None, help="override tabulator for format") - cmdline.add_option("-T", "--notab", action="store_true", default=False, + cmdline.add_option("-T", "--asciitab", action="store_true", default=False, + help="use ascii HT tabulator (csv,md,tab,wide)") + cmdline.add_option("-N", "--notab", action="store_true", default=False, help="do not use tabulator (csv,md,tab,wide)") cmdline.add_option("-P", "--nopadding", action="store_true", default=False, help="do not use padding (csv,md,tab,wide)") - cmdline.add_option("-N", "--noheaders", action="store_true", default=False, + cmdline.add_option("-D", "--noheaders", action="store_true", default=False, help="do not print headers (csv,md,tab,wide)") cmdline.add_option("-U", "--unique", action="store_true", default=False, help="remove same lines in sorted --labels") @@ -1187,7 +1189,7 @@ def extension(filename: str) -> Optional[str]: sys.exit(1) minwidth = int(opt.minwidth) padding = opt.padding if not opt.nopadding else "" - tab = opt.tabulator if not opt.notab else "" + tab = "\t" if opt.asciitab else opt.tabulator if not opt.notab else "" filename = args[0] tabtext = tabtextfile(filename, defaultformat="xlsx") logg.debug("headers = %s", tabtext.headers)