Saving in VisiData #1266
Replies: 3 comments 1 reply
-
Writing this up made me realise #1265 breaks |
Beta Was this translation helpful? Give feedback.
-
Thanks for writing this up @anjakefala, there's so much more going on here than I usually hit 😅 ! A couple initial thoughts:
|
Beta Was this translation helpful? Give feedback.
-
I've a question about saving.
|
Beta Was this translation helpful? Give feedback.
-
We would like to hear your feedback for how you want saving to work in VisiData.
This is a document which hopes to capture all of the relevant considerations and cases, and my understanding of the current behaviour.
The Important Players
{filename}.{ext}
) or a directory (/path/to/foldername/
).options.save_filetype
which is the fileformat to be saved in.''
(or at least, I think that is the plan Revert default VisiData behaviour to choose saver from extension #1265).Behaviour
commit-sheet
(z Ctrl+S
)save_sqlite
.)options.save_filetype
does not affect this behaviour.save-sheet
(Ctrl+S
){filename}.{ext}
) is expected.save_ext
to save to in the fileformatext
. If thissavefunc
is not available, VisiData will fail. (Discussed here: [save] Saving a file without a saver saves to tsv by default. #1072)options.save_filetype
is set, VisiData will save to that filetype preferentially over usingsave_ext
: (Discussed here: Need some way to save different type than file extension #1242).{ext}
for the user save prompt will beoptions.save_filetype or 'vds'
) (Proposed by @geekscrapy)save-sheets
(g Ctrl+S
)/path/to/foldername
or a{filename}.{ext}
.{filename}.{ext}
is provided, the which file format decision behaviour is similar toCtrl+S
, except that thesave_format
chosen must support saving multiple sheets to a single file. (for e.g.save_xlsx
.) If it does not, it will fail./path/to/filename
is provided, then each sheet will be saved as an individual file to that directory. The chosen format isoptions.save_filetype
. If by default,options.save_filetype
is''
, then we will need a fallback (Perhaps'vds'
?) or a fail followed by a prompt asking users to setoptions.save_filetype
on the OptionsSheet.Also relevant to saving
options.confirm_overwrite
is set, and{filename}.{ext}
already exists, the user most be queried before the data is overwritten.options.confirm_overwrite
prompt included the ultimatesavefunc
being used.-b -o
should behave with the same decision tree as if the user was usingCtrl+S
within VisiData.User Preferences based on my understanding
.ext
to take priority, if the user has not been fiddling with anything, and thesavefunc
for it exists (basically, this has been the default behaviour up until now).save_ext
(Need some way to save different type than file extension #1242)..vds
), as long as an existing file is not being over-written in a format that they are not expecting.Beta Was this translation helpful? Give feedback.
All reactions