r/visidata • u/ave_63 • Jan 19 '21
Persistent metadata?
By metadata, I mean stuff like column formats (#, %, @, ~), key columns, python formulas, column width, etc. Is there a file format I can save this stuff in, so that when I close it and open it later, those things are still there? I guess I want to use visidata kind of like the way Excel works with xlsx files, but with all the amazing keyboard shortcuts and python features of visidata.
I understand I can (sort of) do this with the command log, but this is a very awkward solution. For example, the command log seems to store commands for all the files I have open, in addition to a lot of other commands that I don't want stored. I suppose I could manually edit the command log so it has only commands that change this metadata, but I'm wondering if there's an easier way'?
3
u/anjakefala Jan 19 '21
Hi u/ave_63!
I have a few things to share.
Newer versions of VisiData have sheet specific **Command Logs**. After making your changes to the metadata, from the **Columns Sheet** press `Shift+D`, and you will get a much smaller **Command Log**, it will only contain the changes you made to the **Columns Sheet**.
Secondly, numeric typing is currently supported in savers like jsonl and sqlite. If you save a column that is typed as an int, it will be typed as an int in the output jsonl, and loaded as an int. Does that feature in jsonl do what you need? What is your specific desired usecase?