[NUMBER,ST​RING,EVERY​]=xlsread(​"C:\Users\​lenovo\Des​ktop\Sep_2​020_Ericss​on.xls")

Hi all
Kindly help .
I have excel file , and I riun this :
[NUMBER,STRING,EVERY]=xlsread("C:\Users\lenovo\Desktop\Sep_2020_Ericsson.xls")
now, when I run EVERY in command windows , it shows me data like this :
{'Z78NJ037' } {[ 21.93001667]} {[ 39.12541667]}
{'Z78NJ037' } {[ 21.93001667]} {[ 39.12541667]}
{'Z78NJ037' } {[ 21.93001667]} {[ 39.12541667]}
{'Z78NJ851' } {[ 21.5754]} {[ 39.15138333]}
{'Z78NJ851' } {[ 21.5754]} {[ 39.15138333]}
{'Z78NJ851' } {[ 21.5754]} {[ 39.15138333]}
i want to remove the {', and [ .... i want to read directly strings like Z78NJ851, 21.93001667....
How can I reference directly the values of Z78NJ851, or 21.93001667 ..??
Thanks

Risposte (1)

The { [ are display artifacts. For example you can
disp(EVERY{1,1})
and you will observe that those and the ' characters are not actually stored.
I recommend that you switch to using readtable()

4 Commenti

tHANKS WALTER very much .
But this what gives me readtable : how can I increase this limit because I have huge file maybe 3 million
readtable("C:\Users\lenovo\Desktop\Sep_2020_Ericsson.xls")
Error using readtable (line 198)
Range input exceeds bounds for this file extension. Row values must be between 1 and 65536 and columns values must be
between 'A' and 'IV'.
That is an invalid xls file. xls files get corrupted if they have more than 65536 lines.
xlsx files support up to 1048576 rows, which is less than what you have, so you will not be able to use xlsx files either (not unless you use multiple sheets)
i didn't get you.
What is the best solution if I want to process an excel file that have 1048576 rows ?
Which one is best :
1- distributed(datastore(excelFileName));
2- tall(datastore(excelFileName));
3- xlsread()
4- readtable
thanks very very much
If you have exactly one such file, it is likely that readtable() is best. However, I have seen some reports that current readtable() might be considerably slower for large files than using xlsread() is. If you are using more complicated data types such as dates, then readtable() often makes your life a lot easier.
If you do need to use xlsread() then
names = EVERY(:,1);
value1 = cell2mat(EVERY(:,2));
value2 = cell2mat(EVERY(:,3));
and remember that there is a difference between how cells are displayed and what they store, so while
names(1:3)
might display as
{'Z78NJ037' }
{'Z78NJ037' }
{'Z78NJ037' }
the { and } characters are not part of what is really stored, and you can get at what is really stored using {} indexing, like names{1} would be the character vector Z78NJ037

Accedi per commentare.

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Tag

Richiesto:

il 23 Gen 2021

Commentato:

il 23 Gen 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by