Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: unable to open csv file
Posted:
Feb 12, 2013 2:54 PM
|
|
dpb <none@non.net> wrote in message <kfdouj$jjt$2@speranza.aioe.org>... > On 2/8/2013 9:50 PM, neetesh wrote: > > Hi guys > > > > I have a csv file of an image. > > That an image would be in a csv file seems strange at best... > > > This file contains only numbers . In excel it shows around 255 rows and > > 100 columns with negative , zeros and positive numbers. > > when I try to open it using > > csvread('filename') > > > > I get this error message : > > > > ??? Error using ==> dlmread at 145 > > Mismatch between file and format string. > > Trouble reading number from file (row 2, field 1) ==> \n > > > > Error in ==> csvread at 50 > > m=dlmread(filename, ',', r, c); > > > > i tried to change it to txt and open with textread . still doesn't work > > > > please advise > > Need more specifics on the file, obviously. > > --
dpb is correct. We need more specifics. I would note, however, that a csv file can contain non-obvious data in a cell that will generate exactly the error that you are getting. For example:
1.2 2.3 4.5 3.1 5.8 9 l.1 10 8.5
Depending upon the font, it may not be apparent upon inspection that the row 3, col 1 contains lower case L period 1, rather than the decimal 1.1
Note that if I try to read the file using csvread, I get the following error message:
Error using ==> textscan Mismatch between file and format string. Trouble reading number from file (row 3, field 1) ==> l.1,1
Error in ==> csvread at 45 m=dlmread(filename, ',', r, c);
Barry
|
|
|
|