English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
AW: [Caml-list] laconical input from a file for arrays and/or mat rices
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-02-02 (15:41)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] laconical input from a file for arrays and/or mat rices
On Mon, Feb 02, 2004 at 04:33:39PM +0100, Khamenia, Valery wrote:
> Hi Rich and all,
> > Probably not quite what you want, but I have a library for reading and
> > writing comma-separated values (CSV) files here:
> > http://www.merjis.com/developers/csv/
> > http://www.merjis.com/developers/csv/ocaml-csv-1.0.1.tar.gz
> thank you, it would be interesting what's the skeleton idea 
> behind your code, but I can't get it after first apporoach :)

Can you define the problem some more?

Do you have lots of existing files in this particular format which
you'd like to be able to read?  Or are you just looking for a reliable
way to store and load your program data?

If you've got a lot of existing files that you must read in, then
you'll obviously need to write or find a reader for that format.

If you're just looking around for a suitable format for storing and
loading your data, then locate some existing code which already does
this and just use that.  One possibility is indeed CSV, which, despite
its origins in the DOS world, turns out to be quite a useful and
reliable format.  Another is using input/output matrix functions.

You could also try converting from the space-separated format to CSV
format using either a quick Perl script, or even using a spreadsheet
program -- most spreadsheets will let you read in the space-separated
format and write it out in CSV format, which can then be read using
the ocaml-csv library.


Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
"One serious obstacle to the adoption of good programming languages is
the notion that everything has to be sacrificed for speed. In computer
languages as in life, speed kills." -- Mike Vanier

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners