DunneNote · Tutorial
Add a table from a CSV file
Import a CSV file into a DunneNote page as a Data Table with dnfmt, then keep a list in an Editable table from a script.
In this tutorial you'll use dnfmt, the open-source command-line tool for
DunneNote notebooks, to put a spreadsheet export on a page as a table, then keep
a second table up to date from a script. The result looks exactly as if you had
dropped the file onto the page in DunneNote.
You'll need#
dnfmton your path, and DunneNote 0.9.- A notebook, for example the
Trip.dunnenotefrom Create a notebook from a script, closed in DunneNote. - A CSV file such as
bookings.csv, whose first row names the columns:
Place,Nights,Paid,Arrive
Florence,3,true,2026-06-01
Siena,2,false,2026-06-04
Import the file#
- Run
dnfmt ls Trip.dunnenoteand copy the id of the page the table should go on. - Run
dnfmt add-canvas Trip.dunnenotefollowed by the page id,tableandbookings.csv. It prints the new table's id. - Run
dnfmt cat Trip.dunnenotefollowed by the table id. It prints the columns and rows as DunneNote will show them.
The table is a Data Table: it shows the file as it was imported. dnfmt
reads the file the way DunneNote does. The first row names the columns; the
delimiter can be a comma, a semicolon or a tab; Nights is recognised as numbers,
Paid as true or false, and Arrive as dates. The file itself is kept in the
notebook, so the table can always be traced back to it.
A Data Table can't be edited. To change the rows, import a new file, or use an Editable table as below.
Keep a list in an Editable table#
- Run
dnfmt add-canvas Trip.dunnenotefollowed by the page id andtable, with no file. It adds an empty Editable table of three columns and three rows, the same as New table in DunneNote, and prints its id. - Run
dnfmt table Trip.dunnenotefollowed by the table id,add-column "Item". It prints the new column's key, such asc3. - Run
dnfmt table Trip.dunnenotefollowed by the table id,add-row "Item=Tent" "Column 1=Packed". Name columns by their heading or by their key. - To change one cell, run
dnfmt table Trip.dunnenotefollowed by the table id,set, the row id, the column and the new value.
A value that looks like a number is stored as a number, as it is when you type it into the table in DunneNote.
Check it and open it#
- Run
dnfmt verify Trip.dunnenote --full --strict. It ends withok. - Open
Trip.dunnenotein DunneNote. Both tables are on the page, and search finds their contents once DunneNote has rebuilt its index on opening.
Next#
Something unclear or out of date? Open a support ticket.