Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johann-petrak opened this issue May 16, 2022 · 0 comments
Open

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

johann-petrak opened this issue May 16, 2022 · 0 comments

Comments

@johann-petrak
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant