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

Global flag for deleting headers in output? #264

Closed
shenwei356 opened this issue Jan 9, 2024 · 5 comments
Closed

Global flag for deleting headers in output? #264

shenwei356 opened this issue Jan 9, 2024 · 5 comments

Comments

@shenwei356
Copy link
Owner

shenwei356 commented Jan 9, 2024

#258 (comment)

@cbrueffer
Copy link
Contributor

Related to this, or a more general case, would be a global flag --skip-lines N to skip the first N input lines before processing.

My specific use case is csvtk xlsx2csv where the input file contains a few irrelevant first rows. csvkit's in2csv has such a flag (but doesn't let you specify the output delimiter, unlike csvtk, thanks!).

@shenwei356
Copy link
Owner Author

It's relatively easier to implement this now with the current API. But I'm on vacation now. Let me add it to the TODO list.

@shenwei356
Copy link
Owner Author

shenwei356 commented Mar 11, 2024

@cbrueffer what kind of lines do you want to skip?

Do they have the same column number as the left rows?

  1. If yes, that would be simple.
  2. If no, it's difficult to do. One workaround way is csvtk fix | csvtk xxx --skip-rows xx

Do they begin with some special character like #?

  1. If they do, set -C, --comment-char with it.
  2. If no, well, it's difficult.

@shenwei356
Copy link
Owner Author

#258 (comment)

  • add a new global flag -U, --delete-header for disable outputing the header row. Supported commands: concat, csv2tab/tab2csv, csv2xlsx/xlsx2csv, cut, filter, filter2, freq, fold/unfold, gather, fmtdate, grep, head, join, mutate, mutate2, replace, round, sample.

@shenwei356
Copy link
Owner Author

see https://github.com/shenwei356/csvtk/releases/tag/v0.30.0

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

No branches or pull requests

2 participants