help-octave
[Top][All Lists]
Advanced

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

Re: textscan preserving all whitespace


From: rmales
Subject: Re: textscan preserving all whitespace
Date: Fri, 12 Sep 2014 08:10:19 -0700 (PDT)

Thanks to the two of you who have given prompt replies.  I tried them both as
is, and did not get the needed results, both failed.   However, taking the
suggestion of Philip Nienhuis to add the whitespace to the textscan, the
resulting code below worked perfectly:

fid = fopen('ODOC');
tot = textscan (fid, '%s', 'delimiter', '\n', 'whitespace', '');
tot = tot{:};
fclose(fid);


I neglected to make clear in the original post that the file I am reading is
mixed text and numeric, basically legacy from an old Fortran program.  

Here is what more of the file looks like.   The old matlab script I am
converting is pulling information out of this, and is cognizant of the
individual field positions in each line.   After I get all this done, I will
certainly be proposing drastic changes to the approach to modernize it.

COMPUTATION OPTION ILINE=  1
Alongshore gradient IQYDY=  0
ILINE cross-shore lines are computed together

COMPUTATION OPTION IPROFL =  1
Profile evolution is computed from Time = 0.0
to Time =       18000.0  for NTIME =    5

NO ROLLER is included in computation

NO wave and current interaction included

WAVE OVERTOPPING, OVERFLOW AND SEEPAGE
Runup wire height (m)                   RWH=    0.020
Initial crest location for L=1           JCREST=   301
Initial crest height (m) for L=1        RCREST=    8.000
Swash velocity parameter              AWD=    1.600
Output exceedance probability        EWD=    0.015

This is in addition to segments of the file that have the numeric formatting
from my previous post.

Dick





--
View this message in context: 
http://octave.1599824.n4.nabble.com/textscan-preserving-all-whitespace-tp4666470p4666474.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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