When dealing with stdout or delimited files that have multiple consecutive delimiters, I think that allowing cut to treat these as a single delimiter may be advantageous.

When considering a trivial example,
$ wc -l *.dat | grep data
1107 data_01.dat
 180 data_02.dat
 317 data_03.dat
 295 data_04.dat
  10 data_05.dat
$ !! | cut --mult-delim -d " " -f 1,2
1107 data_01.dat
180 data_02.dat
317 data_03.dat
295 data_04.dat
10 data_05.dat

Another example with a data file,
$ tail -n 3 data.dat
AAAA         BBBB         CCCC
1111         2222         3333
XXXX         YYYY         ZZZZ
$ !! | cut --mult-delim -d " " -f 2
BBBB
2222
YYYY

Obviously the flag can be something more suiting.

Though this may be more useful for those users dealing with large delimited files that are not properly formatted to be cut, though more creative folks may be able to use it in some more interesting ways.

While this may disturb files that have legitimately blank fields, it would be off by default to avoid any problems. Treating multiple delimiters as one is common in most spreadsheet applications when importing delimited data.

Any thoughts? My apologies if this is a previously requested feature, though I did not find it in the archives.

Reply via email to