multiple .csv file importing (different row numbers of each file) from a folder

Hi,
I have 100+ .csv files in a folder. Each .csv file has 18 columns and various row numbers. I want to import data from all .csv files from that folder to create a 3-d matrix where the third dimension will be the number of .csv files. Can someone please help me in this regard?
Also, some .csv file has few blank cells. I want to delete those rows and shift bottom rows up while processing those .csv files to create 3-d matrix.

 採用された回答

KSSV
KSSV 2018 年 5 月 16 日
編集済み: KSSV 2018 年 5 月 16 日
files = dir('*.csv') ; % You are in the folder of csv files
N = length(files) ; % total number of files
iwant = cell(N,1) ; % cell because csv files have different rows
% loop for each file
for i = 1:N
iwant{i} = csvread(files(i).name) ;
end

5 件のコメント

Mudasser Seraj
Mudasser Seraj 2018 年 5 月 16 日
Thank you so much.
Mudasser Seraj
Mudasser Seraj 2018 年 5 月 16 日
I also want to delete rows with blank cells and shift bottom rows up. How to do that?
KSSV
KSSV 2018 年 5 月 16 日
Attach one CSV file..
Mudasser Seraj
Mudasser Seraj 2018 年 5 月 16 日
I have attached one .csv file
Mudasser Seraj
Mudasser Seraj 2018 年 5 月 17 日
@KSSV have you figured out a way to do that?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLarge Files and Big Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by