You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How do i read unsupported files rows and columns in Drop down box?
1 view (last 30 days)
Show older comments
Hi Team,
I have few set of unsupported files but can be readable/writable from excel ,
what command do i need to use for Reading these unsupported file's Columns/Rows and display its Headers in My GUI Drop-downs Box ???
25 Comments
dpb
on 23 Dec 2013
Edited: dpb
on 23 Dec 2013
help iofun
and choose from the list what seems to fit the file format the best...there's always fscanf at the basic i/o level.
W/O knowing anything at all about the file structure itself, that's about the best can do...answers can be only as good as the question input supplied.
dpb
on 23 Dec 2013
OP will have to answer for certain, but I'd presume he means something for which there's not an existing Matlab routine to handle, specifically...altho if Excel reads it, one would think it's likely actually a delimited file of some type.
dpb
on 24 Dec 2013
The extension itself has no bearing on anything other than the name; it is simply a convenient identifier for what the content is but that's all it is.
Again, nobody can help w/o specific information on the form of the file...altho as noted above, if Excel reads it the likelihood is that it's simply a delimted file of some sort, the delimiter and content unknown given that you've not posted any snippet to be able to see...
Answers again can only respond to the information provided which is, so far, essentially none.
hussain
on 28 Dec 2013
Every time i try to open those Files using XLSREAD comman , i get error has XLSREAD cannot open this file
Image Analyst
on 28 Dec 2013
Maybe you only think it has no extension because you're using the dumb default choice Windows makes (in an effort to be more like Macs) to hide the extension for known file types. I really really hate that. You can go into Folder Options to uncheck that option and have it show extensions.
dpb
on 28 Dec 2013
Edited: dpb
on 29 Dec 2013
You've yet to show anything of any useful help to diagnose a problem...
a) XLSREAD expects an Excel .xls or other specific Excel file format. It won't care about an extension if it doesn't actually have one altho not having one will obviously break the link to the Windoes automagic file association.
b) Excel, otoh, will open a delimited text file and import it if it can transparently so it's not surprising the same file may be "readable" by Excel.
First use the alternate return from fopen on the file and report what the error message is if the return value fid is -1 --
[fid,msg]=fopen('whateverthefilenameyouthinkis')
That will identify if it's a naming issue or not in the path or the like as it will be a "Not found" type as opposed to anything related to the content.
Then, to check on the extension, use
d=dir('thefilename.*');
d(:).name
and see what is returned. NB: of course, that need the actual file name you think the file has in the above calls. The wild card in the dir argument will return any file of the base name rather than just those w/o an actual extension so you'll see whether there is something there as IA has hypothesized.
After all that, as have requested and at least one other poster asked, paste a few lines of the content of the file (using the {}Code formatter to make it look correct in the Preview window; otherwise the stupid Answers entry form will wordwrap it and it'll be gibberish as far as determining the actual record format.)
hussain
on 31 Dec 2013
Edited: Walter Roberson
on 29 Oct 2016
Hello Friends,
Sorry for asking Vague questions, Please see the attachment for FILE PROPERTIES of file which i am trying to read,
I have tried to read these file using command
[numbers,colNames]=xlsread(file name)
But the ERROR in Command window displays :
Error using xlsread (line 129)
XLSREAD unable to open file
'TR-13-01639-102489473-14a-22b-Aug17a'.
File 'TR-13-01639-102489473-14a-22b-Aug17a' not
found.
Error in LCF_dataprocessing>setpopupmenuString
(line 98)
[numbers,colNames]=xlsread(file name);
Let me know if any more info required
Thanks!!
Hussain
Walter Roberson
on 31 Dec 2013
Please show us the output of
dir TR-13-01639-102489473-14a-22b-Aug17a
dir TR-13-01639-102489473-14a-22b-Aug17a*.*
ls TR-13-01639-102489473-14a-22b-Aug17a*.*
At the moment, xlsread cannot find the files. The files do not exist under that name in that directory. There might be a hidden extension; if so then the ls should show it. Or you might be in the wrong directory.
hussain
on 31 Dec 2013
Edited: Walter Roberson
on 31 Dec 2013
Hello Walter Roberson, Thanks for your Reply,
browse1= TR-13-01639-102489473-14a-22b-Aug17a;
i have used command :
d=dir('browse1')
the COMMAND WINDOWS displays :
d =
0x1 struct array with fields:
name
date
bytes
isdir
datenum
next using ls , command : ls ('browse1')
the command window:
browse1 not found.
Walter Roberson
on 31 Dec 2013
When you put the file names into variables, do not quote them in the calls.
browse1 = 'TR-13-01639-102489473-14a-22b-Aug17a';
d = dir(browse1)
ls(browse1)
ls([browse1 '*.*'])
hussain
on 31 Dec 2013
Hi, check the o/p: browse1 =
TR-13-01639-102489473-14a-22b-Aug17c
d=dir(browse1)
d =
name: [1x36 char]
date: '22-Aug-2013 00:19:32'
bytes: 4911241
isdir: 0
datenum: 7.3547e+05
TR-13-01639-102489473-14a-22b-Aug17c
TR-13-01639-102489473-14a-22b-Aug17c*.* not found.
Walter Roberson
on 31 Dec 2013
The file that you were unable to open before was
TR-13-01639-102489473-14a-22b-Aug17a
and the file that you are finding now is
TR-13-01639-102489473-14a-22b-Aug17c
Notice the difference in ending, "a" compared to "c"
hussain
on 2 Jan 2014
Actually there is no differences,, all are identical files which ever is selected those will be stored in a Variable
Happy new Year
Walter Roberson
on 2 Jan 2014
We need consistency in order to be able to debug properly. Try again with the "a" version.
Also show us the output of
exist('TR-13-01639-102489473-14a-22b-Aug17a')
hussain
on 2 Jan 2014
Edited: Walter Roberson
on 29 Oct 2016
Hello,
Please fine
LCF_dataprocessing
browse1 =
TR-13-01639-102489473-14a-22b-Aug17a
d =
0x1 struct array with fields:
name
date
bytes
isdir
datenum
TR-13-01639-102489473-14a-22b-Aug17a not found.
TR-13-01639-102489473-14a-22b-Aug17a*.* not found.
107 ls (browse1)
TR-13-01639-102489473-14a-22b-Aug17a not found
Using the command : exist('TR-13-01639-102489473-14a-22b-Aug17a')
Output is : ans = 0
Walter Roberson
on 2 Jan 2014
If browse1 is a variable, do not quote it when you pass it to a command.
exist(browse1)
The result 0 from exist('TR-13-01639-102489473-14a-22b-Aug17a') tells us that the file is not found. Which is also what the 0x1 struct array result from dir() tells us.
So now please show us
!ls TR-13-01639-102489473-14a-22b-Aug17* TR-13-01639-102489473-14a-22b-Aug17*.*
hussain
on 2 Jan 2014
Hello Walter Roberson, command used : !ls browse1 (later tried with , *.) o/p in command window ls: cannot access browse1: No such file or directory
it seems matlab is not able to read these files
Walter Roberson
on 2 Jan 2014
Did I say to put in browse1 at that point? Or did I give a complete file name?
If you insist on using browse1 then
system(sprintf('ls %s* %s*.*', browse1, browse1)
do not quote browse1 there!!
hussain
on 2 Jan 2014
Edited: Walter Roberson
on 2 Jan 2014
Hi
I even tried by this
system(sprintf('ls %s* %s*.*', browse1, browse1)
output :
TR-13-01639-102489473-14a-22b-Aug17a not found.
TR-13-01639-102489473-14a-22b-Aug17a*.* not found.
ls: cannot access TR-13-01639-102489473-14a-22b-Aug17a*: No such file or directory
ls: cannot access TR-13-01639-102489473-14a-22b-Aug17a*.*: No such file or directory
Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)