Skip to content

tsv-append: limit number of rows per file? [feature request] #354

Open
@johann-petrak

Description

@johann-petrak

tsv-append is useful for combining several tsv files each with a header line.

However, very often one does this and also wants to combine only the top ki lines of the ith file (e.g. after all those files have been sorted by some criterion).

This can of course be in several steps but since tsv-append already exists, adding a way to do this with this command would make it easy to do this in one easy to understand step.

One way to implement this perhaps would be to make source tracking with -f optional and allow to enable "top-n" processing:

  • enable top-n processing using -T/--topn
  • if -t is specified, specify each file as -f STR=FILE:N
  • if -t is not specified, specify each file as -f FILE:N
  • alternately, specify files without -f as FILE:N

So whenever -T/--topn is specified, if a file ends in ":[0-9]+" then this suffix is used to specify the number of top data rows to include (maximally, if the file is shorter, include everything there is).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions