필터 지우기
필터 지우기

read files in yyyymmddhhmm format

조회 수: 2 (최근 30일)
wave_buoys
wave_buoys 2017년 8월 23일
편집: Stephen23 2017년 8월 23일
Hi,
I have a bunch of files named in yyyymmddhhmm format. For example: 201111010000.txt 201111010300.txt 201111011000.txt 201111011300.txt ... and so on. I want to loop through each file to get the data. Could someone help?
Thanks
  댓글 수: 1
Stephen23
Stephen23 2017년 8월 23일
편집: Stephen23 2017년 8월 23일
Luckily you used the best date format in the world: one of the main benefits of using ISO 8601 is that the dates automatically sort into chronological order. This makes code much simpler and more efficient.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2017년 8월 23일
files = dir('*.txt') ; % you are in the folder of text files
N = length(files) ; % total number of files
for i = 1:N % loop for each file
thisfile = files(i).name ;
%%load the data
% Store if you want or calculate
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by