help-octave
[Top][All Lists]
Advanced

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

RE: reading xls file


From: Ghassen El Montasser
Subject: RE: reading xls file
Date: Mon, 10 Sep 2007 02:11:48 +0200

Hi Hassen,
I think that I know your problem. you can save non headed columns in a csv file, say ('myfile.csv'), and write
>dlmread('myfile.csv',";") # suppose that the separator is ";".
#NB: with the separator";" you can not use: csvread('myfile.csv',";")
# since the function csvread used another function("dlmread") that only consider the separator",".
Now suppose that you saved your non headed columns in a txt file, say('myfile.txt'). To read the next line from fid you can use:
>fid=fopen('myfile.txt');
>tline=fgetl(fid)
you will obtain the first line of 'myfile.txt' and when you repeat the command fgetl you will obtain the other lines. If you want to read all the lines, you can use the following small program:
>fid=fopen('myfile.txt');
>while 1
>tline=fgetl(fid);
>if~ischar(tline), break, end
>disp(tline)
>end
>fclose(fid);
 
cheers

reply via email to

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