Hello,
I have a data file 'Mydata.dat' I want to read with the command 'load
'. I used the command:
load ('Mydata.dat','X');
that does not work. I do not know how?
It should be noted that I have several data files, which I do not know
neither the number of rows nor the number of columns.
Thank you for your help.
|
|
0
|
|
|
|
Reply
|
D
|
2/8/2011 1:31:33 PM |
|
Le 08/02/2011 14:31, D.GH a �crit :
> Hello,
>
> I have a data file 'Mydata.dat' I want to read with the command 'load
> '. I used the command:
>
> load ('Mydata.dat','X');
>
> that does not work. I do not know how?
The load function has to be used only for binary files created by the
save function.
>
> It should be noted that I have several data files, which I do not know
> neither the number of rows nor the number of columns.
>
Do you at least know if it is ASCII or binary files and what is their
format.
If it is ascii files that contains only formatted numerical data
separated with spaces (eventually preceeded by a textual header) you may
try to use the fscanfMat function
If it does not work you can try the functions
- mfscanf for ASCII, C-like formatted numbers
- read for ASCII fortran-like formatted numbers and fortran binary files
- mget for C binary files
but all of them require a knowledge on the way the files are organized
If you did not suceed with those you can send me a file sample, i will
try to help you
Serge Steer
> Thank you for your help.
|
|
0
|
|
|
|
Reply
|
Serge
|
2/8/2011 3:23:34 PM
|
|
On 8 f=E9v, 16:23, Serge Steer <Serge.St...@inria.fr> wrote:
> Le 08/02/2011 14:31, D.GH a =E9crit :> Hello,
>
> > I have a data file 'Mydata.dat' I want to read with the command 'load
> > '. I used the command:
>
> > =A0 =A0 =A0 =A0 =A0 =A0load ('Mydata.dat','X');
>
> > that does not work. I do not know how?
>
> The load function has to be used only for binary files created by the
> save function.
>
> > It should be noted that I have several data files, which I do not know
> > neither the number of rows nor the number of columns.
>
> Do you at least know if it is ASCII or binary files and what is their
> format.
>
> If it is ascii files that contains only formatted =A0numerical data
> separated with spaces (eventually preceeded by a textual header) you may
> try to use the =A0fscanfMat function
>
> If it does not work you can try the functions
> - mfscanf =A0for ASCII, C-like formatted numbers
> - read for ASCII fortran-like formatted numbers and fortran binary files
> - mget for C binary files
> but all of them require a knowledge on the way the files are organized
>
> If you did not suceed with those you can send me a file sample, i will
> try to help you
>
> Serge Steer
>
> > Thank you for your help.
Hi serge,
For data files that contain a single column, for example:
1
2
-4
........
I managed to read the data, using the commands:
u=3Dmopen('donnees1.dat','r');
data=3Dmfscanf(-1,u,'%d')
mclose(u);
Or
fid =3D file ('open','donnees1.dat','unknown')
data =3D read (fid, -1, 1)
file ('close' , fid)
But for the data files that contain more than one column, for example:
Paris 1324
Lyon 124
Rennes 147
Marseille 1478
Strasbourg 547
command below works :
u=3Dmopen('donnees2.dat','r');
data=3Dmfscanf(-1,u,'%s %f')
mclose(u);
Then the following command:
fid =3D file ('open','donnees2.dat','unknown')
data =3D read (fid, -1, 2)
file ('close' , fid)
gives the error message:
-->data =3D read (fid, -1, 2)
!--error 49
Fichier ou format incorrect.
///////////////
Do you have an idea for this problem?
Thank you very much
|
|
0
|
|
|
|
Reply
|
D
|
2/8/2011 7:42:55 PM
|
|
Le 08/02/2011 20:42, D.GH a �crit :
> On 8 f�v, 16:23, Serge Steer <Serge.St...@inria.fr> wrote:
> > Le 08/02/2011 14:31, D.GH a �crit :> Hello,
> >
> >> I have a data file 'Mydata.dat' I want to read with the command 'load
> >> '. I used the command:
> >
> >> load ('Mydata.dat','X');
> >
> >> that does not work. I do not know how?
> >
> > The load function has to be used only for binary files created by the
> > save function.
> >
> >> It should be noted that I have several data files, which I do not know
> >> neither the number of rows nor the number of columns.
> >
> > Do you at least know if it is ASCII or binary files and what is their
> > format.
> >
> > If it is ascii files that contains only formatted numerical data
> > separated with spaces (eventually preceeded by a textual header) you may
> > try to use the fscanfMat function
> >
> > If it does not work you can try the functions
> > - mfscanf for ASCII, C-like formatted numbers
> > - read for ASCII fortran-like formatted numbers and fortran binary files
> > - mget for C binary files
> > but all of them require a knowledge on the way the files are organized
> >
> > If you did not suceed with those you can send me a file sample, i will
> > try to help you
> >
> > Serge Steer
> >
> >> Thank you for your help.
>
> Hi serge,
>
> For data files that contain a single column, for example:
>
> 1
> 2
> -4
> .......
>
> I managed to read the data, using the commands:
>
> u=mopen('donnees1.dat','r');
> data=mfscanf(-1,u,'%d')
> mclose(u);
>
> Or
>
> fid = file ('open','donnees1.dat','unknown')
> data = read (fid, -1, 1)
> file ('close' , fid)
>
> But for the data files that contain more than one column, for example:
>
> Paris 1324
> Lyon 124
> Rennes 147
> Marseille 1478
> Strasbourg 547
> command below works :
>
> u=mopen('donnees2.dat','r');
> data=mfscanf(-1,u,'%s %f')
> mclose(u);
>
> Then the following command:
>
> fid = file ('open','donnees2.dat','unknown')
> data = read (fid, -1, 2)
> file ('close' , fid)
>
> gives the error message:
>
> -->data = read (fid, -1, 2)
> !--error 49
> Fichier ou format incorrect.
>
> ///////////////
> Do you have an idea for this problem?
>
> Thank you very much
The read function is more restrictive, the data contained in the file
must be of homogeneous type (all numbers or all strings)
|
|
0
|
|
|
|
Reply
|
Serge
|
2/10/2011 9:56:15 AM
|
|
On 10 f=E9v, 10:56, Serge Steer <Serge.St...@inria.fr> wrote:
> Le 08/02/2011 20:42, D.GH a crit :
>
> > On 8 f v, 16:23, Serge Steer <Serge.St...@inria.fr> wrote:
> > > Le 08/02/2011 14:31, D.GH a crit :> Hello,
>
> > >> I have a data file 'Mydata.dat' I want to read with the command 'loa=
d
> > >> '. I used the command:
>
> > >> =A0 =A0 =A0 =A0 =A0 =A0load ('Mydata.dat','X');
>
> > >> that does not work. I do not know how?
>
> > > The load function has to be used only for binary files created by the
> > > save function.
>
> > >> It should be noted that I have several data files, which I do not kn=
ow
> > >> neither the number of rows nor the number of columns.
>
> > > Do you at least know if it is ASCII or binary files and what is their
> > > format.
>
> > > If it is ascii files that contains only formatted =A0numerical data
> > > separated with spaces (eventually preceeded by a textual header) you =
may
> > > try to use the =A0fscanfMat function
>
> > > If it does not work you can try the functions
> > > - mfscanf =A0for ASCII, C-like formatted numbers
> > > - read for ASCII fortran-like formatted numbers and fortran binary fi=
les
> > > - mget for C binary files
> > > but all of them require a knowledge on the way the files are organize=
d
>
> > > If you did not suceed with those you can send me a file sample, i wil=
l
> > > try to help you
>
> > > Serge Steer
>
> > >> Thank you for your help.
>
> > Hi serge,
>
> > For data files that contain a single column, for example:
>
> > 1
> > 2
> > -4
> > .......
>
> > I managed to read the data, using the commands:
>
> > =A0u=3Dmopen('donnees1.dat','r');
> > =A0data=3Dmfscanf(-1,u,'%d')
> > =A0mclose(u);
>
> > Or
>
> > fid =3D file ('open','donnees1.dat','unknown')
> > data =3D read (fid, -1, 1)
> > file ('close' , fid)
>
> > But for the data files that contain more than one column, for example:
>
> > Paris =A0 1324
> > Lyon =A0124
> > Rennes 147
> > Marseille 1478
> > Strasbourg 547
> > command below works :
>
> > u=3Dmopen('donnees2.dat','r');
> > =A0data=3Dmfscanf(-1,u,'%s %f')
> > =A0mclose(u);
>
> > Then the following command:
>
> > fid =3D file ('open','donnees2.dat','unknown')
> > data =3D read (fid, -1, 2)
> > file ('close' , fid)
>
> > gives the error message:
>
> > -->data =3D read (fid, -1, 2)
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0!--error 49
> > Fichier ou format incorrect.
>
> > ///////////////
> > Do you have an idea for this problem?
>
> > Thank you very much
>
> The read function is more restrictive, the data contained in the file
> must be of homogeneous type (all numbers or all strings)
Merci Serge,
Thank you for these explanations
|
|
0
|
|
|
|
Reply
|
D
|
2/10/2011 10:14:46 AM
|
|
|
4 Replies
284 Views
(page loaded in 0.155 seconds)
Similiar Articles: Reading a data file with the command 'load' - comp.soft-sys.math ...Hello, I have a data file 'Mydata.dat' I want to read with the command 'load '. I used the command: load ('Mydata.dat','X'); that does not work. sqlldr not recognizing a file without an extension on Solaris ...Reading a data file with the command 'load' - comp.soft-sys.math ... sqlldr not recognizing a file without an extension on Solaris ... Hi, I am running a sqlldr command ... change 'file name' in 'From Multimedia File' simulink block - comp ...Reading a data file with the command 'load' - comp.soft-sys.math ... change 'file name' in 'From Multimedia File' simulink block - comp ... I need to load a avi video into ... Error with loading .dat file - comp.soft-sys.matlabReading a data file with the command 'load' - comp.soft-sys.math ... Hello, I have a data file 'Mydata.dat' I want to read with the command 'load '. ... data =3D read (fid ... load multiple files - comp.soft-sys.matlabReading a data file with the command 'load' - comp.soft-sys.math ... load multiple files - comp.soft-sys.matlab Reading a Line from a file - comp.soft-sys.matlab Well, the ... SQLCI LOAD and BLOCKIN parameter - comp.sys.tandemI need to load a large Enscribe data file into an SQL/MP table. In order to ... those of the COPY command, so it is also good to read the description of the COPY command ... Reading a Line from a file - comp.soft-sys.matlabReading a data file with the command 'load' - comp.soft-sys.math ... load multiple files - comp.soft-sys.matlab Reading a Line from a file - comp.soft-sys.matlab Well, the ... how to unzip a file and view it in a single command line? - comp ...Reading a data file with the command 'load' - comp.soft-sys.math ... Hi serge, For data files that contain a single ... Then the following command: fid =3D file ('open ... Reading and modifying XML file using MATLAB - comp.soft-sys.matlab ...Using a MATLAB script, how would I go about reading in this XML file so that the ... ... values contained in this XML are displayed clearly in the MATLAB command ... Loading DOS 3.3 from a file like ProDOS - comp.sys.apple2 ...Reading a data file with the command 'load' - comp.soft-sys.math ..... the data file that I need to load WILL not have an extension. On DOS ... How to load data from a ... Reading a data file with the command 'load' - comp.soft-sys.math ...Hello, I have a data file 'Mydata.dat' I want to read with the command 'load '. I used the command: load ('Mydata.dat','X'); that does not work. MySQL Load Data Tutorial | eHow.com... data from an external text file. The "LOAD DATA ... Other People Are Reading. MySQL Tutorial for How to Load a Picture ... n line terminator in the LOAD DATA command with ... 7/19/2012 8:19:37 PM
|