[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OT: why loadcsvfile was: How to use passed Octave string parameters
From: |
mpender |
Subject: |
Re: OT: why loadcsvfile was: How to use passed Octave string parameters in C code from an Oct file |
Date: |
Sat, 22 Mar 2014 17:40:09 -0700 (PDT) |
Andreas Weber-3 wrote
> See my other posting for a solution.
> I think you should avoid using C functions like fgets in OCT files and
> use C++ (for example iostream) instead.
I have more experience with C than C++, so when I get stuck on how to do
something complicated I tend to fall back on the C programming techniques
that I know instead of depending on iostream. Since C++ is a superset of C,
it basically boils down to whatever approach makes the most efficient use of
my time, and I'm still updating my knowledge of C++.
Andreas Weber-3 wrote
> Why do you want to implement a function to load csv files? Do you know
> that there is already csvread and csvwrite in octave-core?
Yes; I started by trying those and found that the csvread routine does not
work well with the format of the files I am using. The first comma
separated value in the file is an alphanumeric field that I need to preserve
and csvread always attempts to interpret it as a number and turns it into a
zero.
Consequently, I decided to use a scanf function to extract the relevant
fields instead.
Thanks, Mike
--
View this message in context:
http://octave.1599824.n4.nabble.com/How-to-use-passed-Octave-string-parameters-in-C-code-from-an-Oct-file-tp4663271p4663275.html
Sent from the Octave - General mailing list archive at Nabble.com.