Previously accessible file is now inaccessible

조회 수: 15 (최근 30일)
Hans Sunaryanto
Hans Sunaryanto 2019년 9월 18일
편집: per isakson 2019년 9월 19일
Hi all,
I'm trying to create a code that goes through a few thousand .txt files and extract information from each one to compile to an excel sheet. The first run using the code is always successful and outputs the file I want to see, however any subsequent runs would cause it to throw the error listed above. I've found the only way to get around this is to close out the entire matlab application and restart it again, which isn't very practical. Does anyone have a solution for this?
Thanks in advance!

채택된 답변

per isakson
per isakson 2019년 9월 18일
편집: per isakson 2019년 9월 19일
You need to close the file after reading, add
fclose( fileID )
after
filedata = textscan(fileID, '%s %s %s %s %s %s %s %s');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by