[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading tab-delimited ASCII files
From: |
Matthias Brennwald |
Subject: |
Re: Reading tab-delimited ASCII files |
Date: |
Wed, 08 Aug 2007 09:16:45 +0200 |
User-agent: |
Icedove 1.5.0.12 (X11/20070607) |
On Tue, August 7, 2007 13:11, James Sherman Jr. wrote:
Well, I can't attest to it being any faster, but something like
[v1, v2, v3, v4] = fscanf(fid, "%s%s%s%s", 'Inf')
I tried this. However, only the first line was read into v1, v2, v3 and v4:
[v1, v2, v3, v4] = fscanf(fid, "%s%s%s%s", 'Inf')
v1 = K_G
v2 = 1E-2
v3 = N/A
v4 = 0.1
How do I make fscanf read all lines at once?
v[1-4] are still strings though, so doing some simple
strcmp calls to check if the string is a N/A or an actually number to sort
out the rest.
That should be fine. I actually like having some control on the
conversion of the non-numeric values...
Matthias