descriptionRead numerical data from an ascii text file into a common lisp array and vice versa.
ownersoemraws@xs4all.nl
last changeSun, 12 Aug 2012 16:49:44 +0000 (12 18:49 +0200)
content tags
add:
readme

This package provides functions for reading numerical data from ASCII text files into arrays, and writing numerical data from arrays (up to rank 2) into ASCII text files.

If you compare this to numpy's loadtxt, keep in mind that loadtxt will return data consisting of a single row or single column as an array of rank 1, while it will return multi-row, multi-column data as an array of rank 2. Read-ascii-array will always return an array of rank 2. This seemed to make most sense to me from a programming and ASCII layout point of view.

For behaviour similar to numpy's loadtxt, use read-ascii-vector-or-array, which will reduce the rank for you when possible.

Note that the functions with a * appended (which work on streams) can be used in your own specialized reading functions, such as files that contain text headers, or more complex things including gray streams (such as chipz' decompressing-streams).

Note that this package relies on parse-float, which you can find on github:
git clone git://github.com/soemraws/parse-float.git

shortlog
2012-08-12 Sumant OemrawsinghREAD-ROW* choked on blank lines. Now it skips them... master
2012-05-13 Sumant Oemrawsinghsystem name was wrong
2012-04-05 Sumant Oemrawsinghwrite-ascii-vector-or-array did not work
2012-04-03 Sumant OemrawsinghReplaced erroneous 'float with 'single-float
2012-04-02 Sumant Oemrawsinghin-package was using the wrong package name
2012-04-02 Sumant Oemrawsinghdefpackage defined the wrong name for the package
2012-03-31 Sumant OemrawsinghFixed typos
2012-03-31 Sumant OemrawsinghAdded some more info to README
2012-03-31 Sumant Oemrawsinghfirst commit
heads
11 years ago master