Skipped lines prior to csv data in a file #112
-
Hey... thanks for taking the initiative in updating xsv to qsv. Just a question on skipped lines. I have a few csv files that come in with other information in the top n lines of the file before the header and csv data start. I pre-process this using some other program and resave the file before using tools like qsv. Is there a way to do this in qsv? I could try to add the function similar that was proposed in xsv issue 96 with '--skip-lines' option on input. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @jbertovic , xsv just made our data pipelines much faster and easier to compose, and there were too many low-hanging pending PRs and ideas that we wanted ourselves, so I just scratched the itch. :) And yes, implementing something like I think the most straightforward, cleanest way to enable it is to take advantage of the underlying comment handling capability of the CSV reader that's currently disabled by default. Perhaps, a This should not only handle skipping lines before the header, it should also handle commented records in the rest of the CSV. WDYT? |
Beta Was this translation helpful? Give feedback.
-
For reference, line skipping using comments was functionally implemented by @jbertovic in #113.
|
Beta Was this translation helpful? Give feedback.
For reference, line skipping using comments was functionally implemented by @jbertovic in #113.
He's still looking into implementing a specific--skip-lines
option for theinput
command.--skip-lines
was also added in #266 and is now available starting with qsv v0.41.0.cc @jbertovic @pkptzx