help-octave
[Top][All Lists]
Advanced

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

Fw: Re: fgetl and time in csv file


From: Nicholas Oleng
Subject: Fw: Re: fgetl and time in csv file
Date: Thu, 10 Jul 2008 19:35:51 -0700 (PDT)

Sorry, forgot to attach the file.

--- On Thu, 7/10/08, Nicholas Oleng <address@hidden> wrote:
From: Nicholas Oleng <address@hidden>
Subject: Re: fgetl and time in csv file
To: "John W. Eaton" <address@hidden>
Date: Thursday, July 10, 2008, 6:26 PM

I'm using the same version. I believe the problem is specific to csv files. See for example the following lines with the attached file.

 

fid=fopen("test.csv','r');

y=fgetl(fid)

This gives y = 11/5/2007 1:07,1.000469681,1448764.952,USD->NOK->EUR->SEK
when the first lines below the comma ought to be

11/5/2007  1:07:35 AM

 

Thanks
--- On Thu, 7/10/08, John W. Eaton <address@hidden> wrote:

From: John W. Eaton <address@hidden>
Subject: fgetl and time in csv file
To: address@hidden
Cc: address@hidden
Date: Thursday, July 10, 2008, 5:45 PM

On 10-Jul-2008, Nicholas Oleng wrote:

| I've got a csv file I'd like to read into Octave.
|  
| The typical line is as follows:
| 9/16/2007  5:26:49 PM,1.000675626, 692981.8033,USD->DKK->EUR
|
| Unfortunately, when I use fgetl I get the following:
| 9/16/2007  5:26,1.000675626, 692981.8033,USD->DKK->EUR
| where the :49 PM is omitted for some reason. Note this is how it appears when
opened in Excel, although one can actually view the seconds and PM by clicking
on the individual cell.
|
| How can I remedy this so that Octave can also read the second and the PM?

What version of Octave are you using? Precisely how are you using
fgetl?

I'm unable to duplicate the problem with Octave 3.0.1 on my Debian
system. Here is what I see when I save the line you show above in a
file (foo.dat):

octave:1> f = fopen ("foo.dat", "r");
octave:2> fgetl (f)
ans = 9/16/2007? 5:26:49 PM,1.000675626, 692981.8033,USD->DKK->EUR

If you think you've found a bug, please send a *complete* bug report
to address@hidden (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful
report).

jwe


Attachment: test.csv
Description: Binary data


reply via email to

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