Hi Alex, On 13. Jan, 2015, at 15:37, Alexander Burger <[email protected]> wrote:
. . . >> How difficult would it be to create export and import functions, e.g. >> to and from tab-separated files? This could be separate utilities, i.e. >> not a part of the GUI. > > That's very easy. There is a report mechanism in PicoLisp. You find > examples for that in the demo application in the "app/" directory. The > 'csv' function is called there, e.g. in "sales.l" and "inventory.l". > > Same with import. You can import CSV or XML (an example for the latter > is in http://picolisp.com/wiki/?osmgeodata). But each case is different, > depending on the specialities of the format at hand. > > > If you just want an import/export, you could use 'dump'. > > (load "@lib/too.l") > (out "adrDump.l" > (dump (db nm +Prs @@)) ) > > You can then do (load "adrDump.l") to read the data back. . . . > ♪♫ Alex I’ve got the dump and load working, but I have not yet figured out how to use the 'csv’ function for import from a file (I took a look at "sales.l" and “inventory.l”). Maybe it would be just as easy to generate an adrDump.l file from a CSV file? The only thing that I don’t understand about the adrDump.l file, is the dotted pair after the (+Prs), as here: (obj (+Prs) (1 . 27) Can that dotted pair be generated according to some simple rule? /Jon
