필터 지우기
필터 지우기

Reading huge number of files quickly (I/O)

조회 수: 1 (최근 30일)
Vishnu Swaroop
Vishnu Swaroop 2012년 6월 4일
For analysis of EOD data for stocks, I need to read 3650 .csv files, but using a for loop takes around 30 seconds for 15 files, which would mean around 2 hours just to read data. Is there any way I can do it faster?

답변 (1개)

Walter Roberson
Walter Roberson 2012년 6월 4일
Are you currently reading using csvread(), or import(), or load() ?
If each file has exactly the same structure (same number of fields, some number of headers, same fields are character vs numeric) then you might be able to do better by using textscan()
If you are currently using xlsread() on MS Windows then you can almost certainly do better than you are doing now (but textscan() might be better still). xlsread() opens and closes Excel each time; Image Analyst has posted code several times showing how to open Excel just once and do several operations with it.
  댓글 수: 1
Vishnu Swaroop
Vishnu Swaroop 2012년 6월 4일
yeah, I'm using xls read with a for loop, Will look into your suggestions. Thanks!

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by