User Tools

Site Tools


vd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
vd [2021/06/18 13:02]
dblume
vd [2021/08/06 13:24]
dblume [Case Study: Exported CSV from PG&E]
Line 33: Line 33:
 | , | Select all rows that match this column's value | | , | Select all rows that match this column's value |
 | " | Open duplicate sheet with only selected rows | | " | Open duplicate sheet with only selected rows |
 +
 +==== Case Study: Exported CSV from PG&E ====
 +
 +PG&E CSVs come with 5 rows of metadata followed by Type, Date, Start Time, End Time, Usage, Units, Cost, Notes columns. Delete the five rows of metadata in a text editor, or use ''tail'' to remove them like so:
 +
 +    tail +6 pge_electric_interval_data.csv | vd -f csv -
 +
 +Then prepare your PG&E data like so:
 +
 +^ Key ^ Meaning ^
 +| - | Hide columns TYPE, END TIME, UNITS and NOTES |
 +| C | Go to column mode and... |
 +| t | Select the DATE and START TIME columns |
 +| & | Make a new column that merges them |
 +| q, - | Quit the Column mode, hide DATE and START TIME columns |
 +| O | Go to options mode and... |
 +| e | Set ''disp_date_fmt'' to ''%Y-%m-%d %H:%M'' |
 +| q | Quit options mode. |
 +| @!, %, $ | Set DATE_START_TIME to date format and important, USAGE to float, COST to currency |
 +| = | Add a column, enter ''COST/USAGE'', (Make it float with ''%'') |
 +| %%^%% | Rename COST/USAGE to ''kWh rate'' |
 +| . or g. | Select columns to graph them. Notice rate changes. Notice times of high use. |
 +| +, - | Navigate with hjkl, zoom in and out ([[https://www.visidata.org/docs/graph/|more]]) |
  
 ==== Protip: Use column view to set multiple columns at once ==== ==== Protip: Use column view to set multiple columns at once ====
vd.txt ยท Last modified: 2021/08/09 22:58 by dblume