[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CSV Import
From: |
Tatsuro MATSUOKA |
Subject: |
Re: CSV Import |
Date: |
Sat, 24 Jul 2010 10:14:37 +0900 (JST) |
Sorry I did not see your data in detail.
I have tried csv2cell
C=csv2cell('test.txt',';');
(csv2cell is a function in the octave-forge miscellaneous package )
However
error: cannot reread test.csv
If you split string data obtained by fgets to cellarray, use 'strsplit'.
Please see
help strsprit
Please see the octave manual
6.2.3 Indexing Cell Arrays
The data obtained indexing Cell Arrays like c{2,3} are string.
If you want convert the value (int, double), please see the octave manual
5.6 String Conversions
str2num may be useful function.
Regards
Tatsuro
--- Tatsuro MATSUOKA wrote:
> Hello
>
> Try 'csvread'.
>
> See help csvread.
>
> Regards
>
> Tatsuro
>
> --- aegreen wrote:
>
> >
> > I have a text file of the following format and can't seem to import it into
> > octave? Can someone help me? I've tried using fscanf but it doesn't seem to
> > recognize the end of the line and then I tried to use fgets/fgetl (not sure
> > which one to use) and I get the line and using strsplit I can get it into a
> > cell but I don't know how to use it from there? Can someone help me please?
> >
> > The file looks like this:
> >
> > "Program - b01.02 build 006
> >
> > Identification;Name;Age (yrs);Height(cm);Weight (kg);Gender;Procedure;Model
> > number
> > 0999HT;Testie;19;160;89;Male;;9971
> >
> > Filter:
> > Brachial
> >
> > Time (s);Systolic (mmHg);Diastolic (mmHg);Mean (mmHg);Heart rate
> > (bpm);Stroke Volume (ml);LVET (ms);Pulse Interval (ms);Maximum Slope
> > (mmHg/s);Cardiac Output (l/min);TPR (dyn.s/cm5);Markers;
> > 08:06:26.795;0;0;0;62;0.0;0;970;0;0.0;…
> > 08:06:27.765;0;0;0;61;0.0;0;990;0;0.0;…
> > 08:06:28.755;0;0;0;63;0.0;0;950;0;0.0;…
> > "
> >
> > And I would like to be able to import each column so that I can do some
> > calculations.
> >
> > Thanks,
> >
> > AG
> > --
> > View this message in context:
> > http://octave.1599824.n4.nabble.com/CSV-Import-tp2300503p2300503.html
> > Sent from the Octave - General mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> >
>
>
> --------------------------------------
> Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
> http://pr.mail.yahoo.co.jp/ie8/
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
--------------------------------------
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/