How do i read the following file which has columns of data with header and space or tab delimited, in common lisp.
I also wanted to put the data in to list of list which contains rows.
Also how to get the difference in dates in common lisp
ID YR MO DA YrM MoM DaM
100 2010 2 20 2010 8 30
110 2010 4 30 2010 9 12
112 2010 8 20 2010 10 20
You can read a full line from a stream with READ-LINE. You use WITH-OPEN-FILE to connect a stream to a file given that you have a filename. To get each line as an element of a list means using LOOP:
To split each line into columns requires some effort in basic Common Lisp, but there is this cl-utilities package which contains a function called SPLIT-SEQUENCE that can split a delimited string into a list of tokens.
First search for date-handling yielded http://common-lisp.net/project/cl-date-calc/index.html, which has a DELTA-DAYS function.