-
-
Notifications
You must be signed in to change notification settings - Fork 271
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] add CLI option to use NUL as delimiter #2272
Comments
The way to do this is:
Also is it literally not possible to pass a NUL character into Python from the CLI? Not even with |
Ah right, thanks. Yes, it is impossible for the shell to execute a program with arguments that contain a NUL character, as the argv in the |
Ah, of course. Well, I'd take a PR to make |
Okay, great! |
From @midichef
|
There are two more issues where NUL as delimiter has a mismatch with the traditional TSV behavior.
I'm not sure what the right answer is here. The code that reads piped data makes quite strong assumptions that the piped data is text. (This is why binary file-guessing code like
I'll think about these situations some more. For now, for my specific use cases, the code works well enough. |
Some TSV formats are delineated by |
Okay, makes sense. No, I don't have a case where I want the blank lines to load, the current behavior works for me. |
It's useful to parse output from GNU grep's
-Z
option. That produces lines that in Python aref'{filename}\0{line}\n'
, instead of the usualf'{filename}:{line}\n'
.Right now the command line can't be used to specify a NUL delimiter, as in
vd --delimiter="\0"
, becausesys.argv
strings are NUL-terminated and can't ever contain NUL.My workarounds for now are to use .visidatarc, either add a temporary line:
vd.option('delimiter', '\x00', 'field delimiter to use for tsv/usv filetype', replay=True)
.or add a new filetype to allow
vd -f nsv
:Can
open_nsv()
be written withoutreload()
right now? I couldn't think of another way to setdelimiter
for TsvSheet.The text was updated successfully, but these errors were encountered: