to laod multiple csv files in uitable

2 ビュー (過去 30 日間)
sarfudeen
sarfudeen 2014 年 9 月 30 日
回答済み: sarfudeen 2014 年 10 月 15 日
Hi,
I have 366 nos. of csv files, in each csv files there is of 145 lines. These csv files has to be loaded in uitable.I made it reading the file using fopen and textscan but it takes too much of time to load several csv files.
Kindly please suggest a suitable solution.
Regards, M. Sarfudeen

回答 (1 件)

sarfudeen
sarfudeen 2014 年 10 月 15 日
I used the following code for reading the multiple csv files but for the execution it takes too much of time.
My code is as follows:
[files,path] = uigetfile('*.csv', 'MultiSelect','on');
FileName = fullfile(path,file);
fmt = '%s%s%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%';
num = length(FileName);
data = cell(1,num);
for i = 1 : num
fid = fopen(FileName{i},'r');
data(i) = textscan(fid,fmt,'Delimiter',',',CollectOutput',1);
end
Hence sort out this and help me in this bug at the earliest...
Regards, M. Sarfudeen

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by