Zero-length CSV files
Can mlr be changed so that it does not correct zero length .csv files?
It is quite awkward to handle those files in other programs, and in mlr itself I believe. For instance you join two files with, as it happens, no matching keys. You expect to create a third file and perform another mlr operation eg sort, or cut.. whatever. But you get a zero length file, which does not therefore have any column names. Put another way: what should a .csv without any data be? I contend it should be a single line with field names, not a zero length file.
that word in the first sentence should be "create" not "correct".I cannot figure out how to edit my comment once posted.
I recognize that this has no applicability to other formats (well, some other formats anyway. Have not thought it through in detail)
@spmundi re editing comments -- there is a ... at the upper-right-hand corner of each comment box. Click on that & you'll see 'edit'.
Yes, the header-only CSV file ............................ I really don't know how to handle this in Miller. :(
Same when filtering:
mlr --tsv filter '$n >= 100' input.tsv
If there are no rows, output file is empty (no header). I would also argue that an empty CSV/TSV file should keep the header.