Using VisiData as a spreadsheet

This is a brief evaluation of th vd program.

Using VisiData as a Spreadsheet Alternative

Visidata is an Open Source GPL Licensed data tool. You can use it to enter or inspect or modify column-stored data, the same way you would in a spreadsheet. Its home page is here

and there is a quality tutorial here

Why would one use VisiData rather than LO Calc?

  • the display looks like a spreadsheet
  • it fits in with the inter-usability of Linux utilities
  • it uses Python for writing functions. Pythn is vastly superior to VBA.
  • it can handle millions or rows of data
  • it handles 64 data formats, including csv, json and Excel.
  • it does graphics
  • it works across Linux, OS/X and Win
  • there is good documentation
  • it has some vim-like keybindings

Installing VisiData

In Debian based distros it is available as a package. There seem to be no dependencies.

# apt-get install visidata
.....
Need to get 197 kB of archives.
.....
The following NEW packages will be installed:
  visidata
.....
After this operation, 981 kB of additional disk space will be used.
.....
Preparing to unpack .../visidata_2.11-1_all.deb ...
Unpacking visidata (2.11-1) ...
Setting up visidata (2.11-1) ...
Processing triggers for man-db (2.11.2-2) ...

If you really must have the latest version, the Github site is here

Getting started

We might mention the cheat sheet here

I have a little .csv test file

"Rowno","Tagpros","Slideno","Tagarmid","Dpccperfoll" 
"1"," A8000"," 431/80  "," 71E4012",51.85 
"2"," B0660"," 006/85  "," 71E4533",85.7 
"3"," A7994"," 424/10/1"," 72E4030",124.05
"4"," A8010"," 428/80  "," 72E4078",36.4

To read that into VisiData

vd dpcc -f csv

Visidata uses file extensions to identify file types. If the file extension is missing ( like here) you have to tell it the filetype with -f csv. Simpler to use extensions,
With that comand I get a terminal window like this

Lets say I want to edit the data value β€˜36.4’ in the bottom row.
I move to that row, and across to the last column…

Then I enter β€˜e’, the new value, then enter… done.

VisiData does not write on the current file. To save use Ctrl s filename … give the saved file a new name

Then to quit `q`
Both files will be there.
I can move around between cells with arrow keys ( or with vi's h,j,k,l keys)

Make a new table and enter some data

I can start am empty table with

vd new.vd

I get one cell

Lets say I have some rainfall data … 2 columns … Date and Rainfall in mm.
I need to rename the first column, so β€˜^’ , and I get the opportunity to type in β€˜Date’ as its heading. I need to set the column type to β€˜data’ so β€˜@’.
Then I need to add a column , so β€˜za’ and it lets m name it β€˜Rainfall’, and I can set its type to floating point with β€˜%’.

Now it looks like this

Now, how can I add some rows of data?

I might save first

Ctrl s new.vd
and enter a filename ... 'new.vd' is mine

I can create some blank rows with

ga 5

makes 5 blank rows, then
I can move to the first column, second row , press β€˜e’, and enter 22/10/25 for Date and 15.0 for Rainfall.
When I start editing it changes the table to

and I cant see how to get back to the normal table?
That is a failure.
If I have to edit in every value with β€˜e’ , it would simpler to do it in an editor, then read the file into β€˜vd’.
Maybe β€˜vd’ is not meant for data entry?

A larger dataset

I have a blank separated .csv file where each row is a sheep and columns are either ID’s or data such as dermal papilla cell count, bodyweight, woolweight, etc.
First try

vd --csv-delimiter=" " dpcc.csv

reads it OK, but it adds a column of row numbers at column 1 and gets the headers out of wack. I fix that by adding an extra header to the file. Then it looks like

That is correct now.
Lets see what we can do with these data
Try to plot DpccperFollicle against wool weight(cww and cww2) and fibre diameter(Diam).
Here are the steps

  • choose the dpcc column
  • % to make it float
  • ! to set it as the X axis
  • choose the Cww column
  • % to make it numeric
  • also make the cww and cww2 columns numerig
  • g..

and I get

… dpccgraph.png

OK, there is a relationship of dpcc with fibre diameter, but not with wool weight. I am not impressed with either

  • the strange set of key commands
  • the graph quality

but it is quite automatic.

Can VisiData work with a pipe

Yes VisiData will work with othertools in a pipeline

df | vd

gives

… vdpipe.png

That is what I meant by β€œit fits in with the inter-usability of Linux utilities”.It is designed to work at the terminal.

Conclusion

It may be usefile, especially for converting data file formats, but I am finding it irritating and limited. Maybe others can see some opportunities here?

7 Likes

Apologies. I have noticed, too late, that my screenshot images ( taken in Devuan) are showing as not 100% opague.
That is strange, in every other Linux I have used, when you use screenshot , it changes to 100% opague before snapping.
It is the standard Xfce screnshot utility.
I shall investigate.

Update:
It seems I have to incrrease the opacity of inactive windows in Settings β†’ Window Manager Tweaks β†’ Compositing

Either that or turn off compositing altogether.
screensaver does not seem to have any relevant settings

Update 2:
I also note that on the plot image, the points are near invisible.
That is another black mark for vd … the graphs are nowhere near publication quality.

Update 3:
I also notice the imsges are not expandable ( at least not on my tablet) . That must be because I loaded them with an html instruction inside the markdown file … ie I did not use the upload button in the discourse editor.

Oh dear, that is all a mess… sorry.

3 Likes

Interesting. I understand and use LO Calc. Visidata seems to present no advantage. Or its advantages are too advanced for me to understand.

3 Likes

@nevj :

Hi Neville, :wave:

thank you for publishing the findings of your experiment with visidata.
YouΒ΄ve done a great job giving us an understanding of whatΒ΄s it about and how it works. :+1:

All of this was new to me.

Accoding to my information:

VisiData is an open-source command-line tool for exploring and analyzing tabular data in Linux. It allows users to quickly load, manipulate, and visualize data from various sources like CSV, Excel, and SQL databases, making it a versatile option for data analysis.

Supports Various Formats: VisiData can open and manipulate data from multiple sources, including:
CSV
Excel (.xls/.xlsx)
JSON
SQL databases
Pandas DataFrames
HDF5
And more

(from duckduckgoΒ΄s Dearch Assist)

ThatΒ΄s interesting. IΒ΄ve always been using sqlitebrowser for looking at sqlite files.
I might look into visidata as an alternative to it.

Thanks for your great work, Neville.

Many greetings from Rosika :slightly_smiling_face:

3 Likes

Hi Rosika,
Maybe that is what vd is good at … just a viewer for alll sorts of data files?
Remember, you can pipe to it.
Regards
Neville

4 Likes

Not too advanced, too simple.
I think I was trying to use it like a spreadsheet … it is not really that … it is more a viewer with a few processing abilities.
So, it is like cat for data files.

5 Likes

I have an ugly basic quick and dirty shell script to show a CSV file properly β€œtabulated”

╭─x@titanii ~/Pictures/working/2025/ghosts  
β•°β”€βž€  bat ~/bin/cli-excel
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       β”‚ File: /home/x/bin/cli-excel
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   β”‚ #!/usr/bin/env bash
   2   β”‚ # read a csv in the terminal
   3   β”‚ # column -s, -t < eni-linux-list.csv | less -#2 -N -S
   4   β”‚ # expect an input file name
   5   β”‚ PROG=$(basename $0)
   6   β”‚ CSVFILE=$1
   7   β”‚ if [ "$#" -lt 1 ] ; then
   8   β”‚         echo "need argument - expecting a CSV file..."
   9   β”‚     echo "e.g. : $PROG filename.csv"
  10   β”‚         exit 1
  11   β”‚ fi
  12 ~ β”‚ # column -s, -t < $CSVFILE|grep -v \# | less -#2 -N -S
  13 ~ β”‚ # column -s, -t < $CSVFILE|grep -v \# | less -#2 -N -S
  14 ~ β”‚ grep -v \# $CSVFILE | column -s, -t |less -#2 -N -S
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
5 Likes

Still need to check it, but if it reads sqlite data, I could use it to look at some things.
I have some headless systems practically only accessible via ssh, on these systems Visidata may come handy to look at tabular data…

5 Likes

Hi Neville, :waving_hand:

Yes, I see. Your example:

… looks quite interesting. ThatΒ΄s certainly a good feature of visidata.

Thanks again and many greetings from Rosika :slightly_smiling_face:

4 Likes

IOW, a tool I don’t need because I don’t understand it.

3 Likes

Thank you for the VisiData review. .csv files are used a lot for Amateur Radio programming and .json for scanner apps (TrunkRecorder, etc) - so, this could be useful there. I’m familiar with Devuan but use the non-systemd version of MX Linux, instead. (It can get interesting sometimes as to many have gone down the systemd road, so finding help with for non-systemd apps can be challenging.) I may try VisiData with the small qutebrowser. Thanks again.

3 Likes

Hi @kd4e ,
I have never had any difficulty with apps in non-systemd distros… I use Devuan with openrc, MX with sysvinit, and Void with runit. I have also tried Artix with dinit.
I think it depends on what apps you regularly use… there are indeed a few apps that require systemd.

I did the work with VisiData in Devuan , but it could have equally well been done in any distro. VisiData does not have any nasty init system dependencies.

I think I misjudged VisiData… it is not really a spreadsheet alternative… more a data viewer and converter. As such it may work well with your .csv and .json files.

Regards
Neville

3 Likes

Are you saying that you cannot edit a spreadsheet at all, using VisiCalc, or just that it’s awkward and limited? (I’m setting up a Linux server to include NFS and NAS - that’s where online instructions for non-systemd got a little thin.)

1 Like

No, you can edit any table in VisiData.
I found it strange… lots of new key shortcuts to remember.
Plain one cell editing seems OK.
Entering blocks of data by hand seems awkward… maybe I just did not master it.?

Which init system was it. ?
I think I could help with that, if you still need it.
I have done NFS in most init systems. It mostly comes down to what daemons do you need to start and in what order.

3 Likes