|
Howdy all- I'm struggling to understand how to use the fill ('f') command. I got it to work briefly but for some reason I'm doing the same thing again and it's not working. I want to fill empty cells with the value of the first non-empty cell above them. So that something like this:
turns into this:
When I briefly got it to work, I'd select the empty rows and activate the column I was interested in and hit 'f'. I'd have to do this for each block of empty rows. I don't know what changed, but now when I'm trying this it just says "filled 0 values" every time. At the very least I'd like to understand how to get back to it working the way it (briefly) was before, but ideally there'd be a way to just fill every empty cell with the value of the first non-empty cell above them? That seems to be what's described in the man page. Obviously the first thing is doable (though I don't know why I can't anymore). Is there a way to do the second thing? I'm using v3.3, which appears to be the most recent version available on conda-forge. |
Replies: 2 comments
|
Fill is skipping your blank cells because it's looking for cells containing Visidata's null value. The null value is almost always Python's The way I would do it is, change those cells to contain Alternatively, you could change what Visidata considers to be the null value, to the empty string instead of As for why it worked for you before, I don't know. Maybe your data was in a fixed-width file, loaded via |
|
This is very helpful, thank you! |
Fill is skipping your blank cells because it's looking for cells containing Visidata's null value. The null value is almost always Python's
None, which is drawn on screen as⌀. Your cells are blank, which means they contain the empty string''.The way I would do it is, change those cells to contain
Nonefirst: navigate to one of your blank cells. Press,to select all the cells with the same value, then set them toNoneviagzd(delete-cells). Then pressf.Alternatively, you could change what Visidata considers to be the null value, to the empty string instead of
None:On startup:
vd --null-value=''Or by adding to your .visidatarc:
options.null_value = ''Or, to modify it just for one …