[scilab-Users] tutorial on ASCII file parsing commands?

Pierre JUILLARD pierre.juillard at gmail.com
Fri Aug 27 13:27:21 CEST 2010


Dear all,

I would like to know if there is some kind of tutorial (either in pdf or in
the scilab wiki) presenting the Scilab parsing commands so that it is
possible to read, write, appened an ASCII file (preferably with some
examples)?

I had a quick look on Scilab wiki.
I see that there are tutorials for optimizations.
Is there a similar one about file parsing?
(ok, these are far lessinteresting functions scientifically speaking)

Actually, the basic functions I am intersting in is:

______________________________________________________
1- read from an input file, input data to be used in a loop (robustness
study) so as to perform calculation in a loop.
A function to read a file of the type below, storing the result in a table
and looping over the table content would be perfect

(example of file content: one line per iteration)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
variable1Values,  variable2Values, variable3Values
myDataFile1.inp,    3.14              , string1
myDataFile2.inp,    3.12              , string2
myDataFile3.inp,    3.18              , string3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________________
2- read the result in an ASCII file recognizing some keywords.

(example of file content: one result per line at one iteration, file is
generated at every iteration)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
result of objective 1: 20
result of objective 2: 34,55555
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________________
3- at each iteration, appening a conslidated result file (ie a "knowledge
base")

(example of file content: one iteration per line)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
variable1Values,  variable2Values, variable3Values, resultOfObjective1,
resultOfObjective2
myDataFile1.inp,    3.14              , string1            ,
20,                       34.5555
myDataFile2.inp,    3.12              , string2            ,
22.6,                    37.1
myDataFile3.inp,    3.18              , string3            ,
21.8,                    35.6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________________

I thank you in advance for any help.
Bests,

Pierre

PS: just a small feedback on the Scilab wiki page:
http://wiki.scilab.org/Tutorials
There is redundant "language" document classification:
tables are separated by langauges (english, french, others...) and recalled
in the 1st column: this may not be necessary for the 2 first tables.
Also, some french documents appear in the english table.
Should I help cleaning it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100827/9579ef89/attachment.htm>


More information about the users mailing list