You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,9 +382,9 @@ $ tsv-uniq --help # Valid
382
382
$ tsv-uniq -help # Invalid.
383
383
```
384
384
385
-
#### Help (-h, --help, --help-brief)
385
+
#### Help (-h, --help, --help-verbose)
386
386
387
-
All tools print help if given the `-h` or `--help` option. Several tools provide a brief form of help with the `--help-brief` option.
387
+
All tools print help if given the `-h` or `--help` option. Many of the tools provide more details with the `--help-verbose` option.
388
388
389
389
#### Field indices
390
390
@@ -400,9 +400,9 @@ Any character can be used as a delimiter, TAB is the default. However, there is
400
400
401
401
Aside from a header line, all lines are expected to have data. There is no comment mechanism and no special handling for blank lines. Tools taking field indices as arguments expect the specified fields to be available on every line.
402
402
403
-
#### Headers (--header)
403
+
#### Headers (-H, --header)
404
404
405
-
Most tools handle the first line of files as a header when given the `--header` option. For example, `tsv-filter` passes the header through without filtering it. When `--header` is used, all files and stdin are assumed to have header lines. Only one header line is written to stdout. If multiple files are being processed, header lines from subsequent files are discarded.
405
+
Most tools handle the first line of files as a header when given the `-H` or `--header` option. For example, `tsv-filter` passes the header through without filtering it. When `--header` is used, all files and stdin are assumed to have header lines. Only one header line is written to stdout. If multiple files are being processed, header lines from subsequent files are discarded.
406
406
407
407
#### Multiple files and standard input
408
408
@@ -421,8 +421,9 @@ Filter lines of tab-delimited files via comparison tests against fields. Multipl
421
421
422
422
**General options:**
423
423
*`--help` - Print help.
424
-
*`--help-brief` - Print brief help (option summary).
425
-
*`--header` - Treat the first line of each file as a header.
424
+
*`--help-verbose` - Print detailed help.
425
+
*`--help-options` - Print the options list by itself.
426
+
*`--H|header` - Treat the first line of each file as a header.
tsv-join matches input lines against lines from a 'filter' file. The match is based on exact match comparison of one or more 'key' fields. Fields are TAB delimited by default. Matching lines are written to standard output, along with any additional fields from the key file that have been specified.
525
526
526
527
**Options:**
528
+
*`--h|help` - Print help.
529
+
*`--h|help-verbose` - Print detailed help.
527
530
*`--f|filter-file FILE` - (Required) File with records to use as a filter.
528
531
*`--k|key-fields n[,n...]` - Fields to use as join key. Default: 0 (entire line).
529
532
*`--d|data-fields n[,n...]` - Data record fields to use as join key, if different than --key-fields.
530
533
*`--a|append-fields n[,n...]` - Filter fields to append to matched records.
531
-
*`--header` - Treat the first line of each file as a header.
534
+
*`--H|header` - Treat the first line of each file as a header.
532
535
*`--p|prefix STR` - String to use as a prefix for --append-fields when writing a header line.
533
536
*`--w|write-all STR` - Output all data records. STR is the --append-fields value when writing unmatched records. This is an outer join.
534
537
*`--e|exclude` - Exclude matching records. This is an anti-join.
tsv-select reads files or standard input and writes specified fields to standard output in the order listed. Similar to 'cut' with the ability to reorder fields. Fields can be listed more than once, and fields not listed can be output using the `--rest` option. When working with multiple files, the `--header` option can be used to retain only the header from the first file.
621
622
622
623
**Options:**
624
+
*`--h|help` - Print help.
623
625
*`--H|header` - Treat the first line of each file as a header.
624
626
*`--f|fields n[,n...]` - (Required) Fields to extract. Fields are output in the order listed.
625
627
*`--r|rest none|first|last` - Location for remaining fields. Default: none
626
628
*`--d|delimiter CHR` - Character to use as field delimiter. Default: TAB. (Single byte UTF-8 characters only.)
627
-
*`--h|help` - Print help.
628
629
629
630
**Examples:**
630
631
```
@@ -693,8 +694,8 @@ Summarization operators available are:
693
694
Calculations hold onto the minimum data needed while reading data. A few operations like median keep all data values in memory. These operations will start to encounter performance issues as available memory becomes scarce. The size that can be handled effectively is machine dependent, but often quite large files can be handled. Operations requiring numeric entries will signal an error and terminate processing if a non-numeric entry is found.
694
695
695
696
**Options:**
696
-
*`--h|help` - Brief help.
697
-
*`--help-verbose` - Print full help.
697
+
*`--h|help` - Print help.
698
+
*`--help-verbose` - Print detailed help.
698
699
*`--g|group-by n[,n...]` - Fields to use as key.
699
700
*`--H|header` - Treat the first line of each file as a header.
700
701
*`--w|write-header` - Write an output header even if there is no input header.
@@ -746,12 +747,13 @@ This program does not validate CSV correctness, but will terminate with an error
746
747
UTF-8 input is assumed. Convert other encodings prior to invoking this tool.
747
748
748
749
**Options:**
749
-
*`--header` - Treat the first line of each file as a header. Only the header of the first file is output.
750
+
*`--h|help` - Print help.
751
+
*`--help-verbose` - Print detailed help.
752
+
*`--H|header` - Treat the first line of each file as a header. Only the header of the first file is output.
750
753
*`--q|quote CHR` - Quoting character in CSV data. Default: double-quote (")
751
754
*`--c|csv-delim CHR` - Field delimiter in CSV data. Default: comma (,).
752
755
*`--t|tsv-delim CHR` - Field delimiter in TSV data. Default: TAB
753
756
*`--r|replacement STR` - Replacement for newline and TSV field delimiters found in CSV input. Default: Space.
754
-
*`--h|help` - Print help.
755
757
756
758
### number-lines reference
757
759
@@ -760,11 +762,11 @@ UTF-8 input is assumed. Convert other encodings prior to invoking this tool.
760
762
number-lines reads from files or standard input and writes each line to standard output preceded by a line number. It is a simplified version of the Unix 'nl' program. It supports one feature 'nl' does not: the ability to treat the first line of files as a header. This is useful when working with tab-separated-value files. If header processing used, a header line is written for the first file, and the header lines are dropped from any subsequent files.
761
763
762
764
**Options:**
763
-
*`--header` - Treat the first line of each file as a header. The first input file's header is output, subsequent file headers are discarded.
765
+
*`--h|help` - Print help.
766
+
*`--H|header` - Treat the first line of each file as a header. The first input file's header is output, subsequent file headers are discarded.
764
767
*`--s|header-string STR` - String to use as the header for the line number field. Implies --header. Default: 'line'.
765
768
*`--n|start-number NUM` - Number to use for the first line. Default: 1.
766
769
*`--d|delimiter CHR` - Character appended to line number, preceding the rest of the line. Default: TAB (Single byte UTF-8 characters only.)
Copy file name to clipboardExpand all lines: number-lines/src/number-lines.d
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,9 @@ struct NumberLinesOptions {
54
54
try {
55
55
auto r = getopt(
56
56
cmdArgs,
57
-
"header", " Treat the first line of each file as a header. The first input file's header is output, subsequent file headers are discarded.", &hasHeader,
57
+
std.getopt.config.caseSensitive,
58
+
"H|header", " Treat the first line of each file as a header. The first input file's header is output, subsequent file headers are discarded.", &hasHeader,
59
+
std.getopt.config.caseInsensitive,
58
60
"s|header-string", "STR String to use in the header row. Implies --header. Default: 'line'", &headerString,
59
61
"n|start-number", "NUM Number to use for the first line. Default: 1", &startNum,
60
62
"d|delimiter", "CHR Character appended to line number, preceding the rest of the line. Default: TAB (Single byte UTF-8 characters only.)", &delim
0 commit comments