I want to convert my .csv file to fit my code
3 次查看(过去 30 天)
显示 更早的评论
Hi Everybody, I have excel file and I have modified it into number of columns manually. To fit my code. But, as I have large amount of data it is difficult to change the structure manually. Can I generate a automatic script to modfie my original excel into number of columns. I have added the both original and modified excel. And the code i am using to fetch the data from excel.
Thanks in advance.
[~, ~, dataOverview] = xlsread('Overview_modified.xlsx',sheets(ic,:),'A3:E134');
dataOverview(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),dataOverview)) = {''};
%extracts the data into seperate columns as per the need
[n_l,~] = size(dataOverview);
CellType = dataOverview(:,1);
Cell = dataOverview(:,2);
Sequence = dataOverview(:,3);
TestID = dataOverview(:,4);
TestName = dataOverview(:,5);
1 个评论
JohnGalt
2018-6-6
It is absolutely possible in Matlab, though it would not be my first choice. I'd suggest doing this formatting outside of matlab, perhaps in excel... or convert your data to csv which will reduce the computational overhead.
To do it in matlab, you essentially read it all in as a giant array and then reorganise it - as you would on another platform.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!