フィルターのクリア

how can i write loop for 32 files which are in .csv formated?

1 回表示 (過去 30 日間)
Reddy gireesh
Reddy gireesh 2016 年 6 月 7 日
コメント済み: KSSV 2018 年 6 月 1 日
I have .csv file for one month named like tc010316.csv,tc020316.csv,........,tc310316.csv,data_log.csv (tcddmmyy.csv formatted). each file represents one day data arranged in number of columns (53) and rows (288 roughly). Data formatted like columns respectively., Date(2-Mar-16),time(0:00),Data(573 ng).......... Date column same for hole data time is five minute average. i want to find out one day average for all columns separately and for month as well., provide me code to get out of this issue. i have tried lot of codes but loop is not continuing.

回答 (1 件)

KSSV
KSSV 2016 年 6 月 7 日
編集済み: KSSV 2018 年 6 月 1 日
csvfiles = dir('*.csv'); % You are in the folder of csv files
Nfiles = length(csvfiles) ; % total number of csv files
% loop for each file
for i = 1:Nfiles
fname = csvfiles(i).name ; % file name
[num,txt,raw] = xlsread(fname) ; % read the data from csv file
%%do what you want %%%
end
  7 件のコメント
Khushi Bhatti
Khushi Bhatti 2018 年 6 月 1 日
KSSV... this code didn't work for me :( .its not reading all the files
KSSV
KSSV 2018 年 6 月 1 日
Use xlsread instead of csvread. Code edited. Check now.

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

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by