help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading ASCII data files quickly


From: Jaroslav Hajek
Subject: Re: Loading ASCII data files quickly
Date: Thu, 13 Aug 2009 09:15:04 +0200

On Thu, Aug 13, 2009 at 9:03 AM, Prof M. N.
Anandaram<address@hidden> wrote:
> Hello:
> Ineed help to read  a long datafile (produced by fortran) of which the 
> following is a sample:
> Its 5 columns are separated by single spacing but many blanks have minus 
> signs also!
> -----------------------------------------------------
> %Model no   1  Age =  0.000 Gyr
> %      2482        15        25       210
>
>  6.099804898E+10 5.737968142E-11  4.263896084E+03 
> 1.075125032E+03-3.921649350E-09
>  7.091014190E-01  2.728385055E+33 6.643099358E-03  0.000000000E+00 
> 1.642454464E+00
>  3.898655209E-01 1.006586011E+00 1.660402559E+08 8.786761647E-01 
> 3.104463343E+03
>  0.000000000E+00 1.962800000E-02-3.650469325E+07 0.000000000E+00 
> 0.000000000E+00
>  0.000000000E+00 0.000000000E+00 0.000000000E+00 4.587748349E-03 
> 9.782398920E-03
>  6.099764772E+10 5.734173867E-11 4.264186105E+03 1.132813429E+03 
> 4.132080236E-09
>  7.091014190E-01 2.728385055E+33 6.929622832E-03 0.000000000E+00 
> 1.643060192E+00
>  3.901287825E-01 1.006268590E+00 1.658643758E+08 8.786761647E-01 
> 3.104635028E+03
>  0.000000000E+00 1.962800000E-02-3.610343816E+07 0.000000000E+00 
> 0.000000000E+00
>  0.000000000E+00 0.000000000E+00 0.000000000E+00 4.587748349E-03 
> 9.782398920E-03
>  6.099724280E+10 5.730138513E-11 4.264507760E+03 1.194167602E+03 
> 4.355834394E-09
>  7.091014190E-01 2.728385055E+33 7.231427131E-03 0.000000000E+00 
> 1.643677166E+00
>  3.903977435E-01 1.005974269E+00 1.656907498E+08 8.786761647E-01 
> 3.104782331E+03
>  0.000000000E+00 1.962800000E-02-3.569851372E+07 0.000000000E+00 
> 0.000000000E+00
> ------------------------------------------------------
> When I used the tdmread() program (see far below) on this file it responds by:
>
>>D:\Octave\bin\octave.exe -q "tdmread.m"
>   parse error near line 1 of file D:\Octave\fgong_l9bi_d_01s_01.m
>   syntax error
>>>>  6.099804898E+10 5.737968142E-11 4.263896084E+03 
>>>>1.075125032E+03-3.921649350E-09
>                                    ^
> error: evaluating assignment expression near line 1, column 5
> error: near line 1 of file `tdmread.m'
>>Exit code: 1
>
> Can any one please help ? It is imp that - sign be read with attached number 
> also.
>
> Anandaram

Michael's code works for me with your sample data; you are not using
it properly. You should start Octave prompt and the invoke the
function with the file name as an argument.


-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]