Textscan not reading an entire file
조회 수: 4 (최근 30일)
이전 댓글 표시
I have multiple files in excel format .js . The files are identical, only the number or rows change. I used textscan to read in the data, and everything was working fine. Today after maybe one month of not using that script I tried to load in the data for only 2 files and I noticed that the first file is loaded in correctly, but the second one loads only up until 172 rows (and the file has 286). I tried loading only the problematic file, with the same results. I have saved data in matlab from one month ago, and then it was successfully loaded. I also downloaded that file again, in case it was corrupt. I use matlab R2010b 64bit. Here is the code:
myFolderPV = 'C:\...\test/';
PVFiles = dir(fullfile(myFolderPV,'*.js'));
for k = 1:2
fid = fopen(PVFiles(k).name);
tempDay {k} = textscan(fid, '%*s %s %*[^\n]', 'delimiter',' " ');
fclose (fid);
end
UPDATE: I tried to run the script on the other computer, and everything works fine.. So my guess is the problem is with my version of Matlab (but it worked before) or something changed with the configuration of my PC.. Any ideas? Thank you for your help, Ante
댓글 수: 1
Jan
2013년 5월 14일
편집: Jan
2013년 5월 14일
Usually ".js" are not Excel files. textread() cannot read Excel files, except you are talkinmg of tab separated text files - but it is brute to call them "Excel files".
It would be easier to understand the problem, when you post the contents of the last imported line. You mention "problems with your version of Matlab", but show us the version of the successful Matlab only.
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!