Skip to content

How to ignore last line of a CSV #259

Answered by jqnatividad
jqnatividad asked this question in Q&A
Discussion options

You must be logged in to vote

This can be handled several ways:

  • using qsv:

    1. Starting with qsv v0.42.0, with input, using the --skip_lastlines option (ping @pkptzx)
    2. Alternatively, set QSV_COMMENT_CHAR env var to a character like #, and then have the last line start with that char.
  • with sed:
    sed -i '$d' <file>

  • with head:
    head --lines=-1

more info here - https://unix.stackexchange.com/questions/52779/delete-last-line-from-the-file

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jqnatividad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant