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

Allow specifying on CLI the number of lines to load from a file #2356

Closed
2 tasks done
jwnacnud opened this issue Mar 20, 2024 · 1 comment
Closed
2 tasks done

Allow specifying on CLI the number of lines to load from a file #2356

jwnacnud opened this issue Mar 20, 2024 · 1 comment

Comments

@jwnacnud
Copy link

jwnacnud commented Mar 20, 2024

If I have a large file, certainly I can just HEAD it to get the lines I want. I'd love to run the following:

vd -n100000 filename.csv

and have visidata simply open the first 100,000 records of the file. I know I can ctrl-c to stop along the way on a large file but that's not consistently stopping in the same place. I also know that I can head the file, if the file supports that, which parquet doesn't.

Am I just dreaming?

  • what should the helpstring say
    This value indicates how many records will be loaded from the input file (default, all of them)
  • where should this command go in the menu system
    ON INPUT, not in the menu system.
@anjakefala anjakefala changed the title It would be nice to specify, as a command-line parameter, the number of lines to import from a file... Allow specifying on CLI the number of lines to load from a file Mar 20, 2024
@saulpw
Copy link
Owner

saulpw commented Oct 2, 2024

Hi @jwnacnud, I added a --max-rows option that works on most source sheets. The -n CLI flag is already an alias for --nonglobal, so there's no short option alias for now. If you can think of a reasonable one (that isn't already used), please suggest it.

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

3 participants