How to obtain one excel file instead of multiple file?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have 10 excel file in a folder. I have fetch 1st column from each file using for loop. I want to create another excel file containing these 10 column, but I get 10 different excel file instead of one file. How can I overcome this problem?
Area{i}=xlsread(filename,sheet,'A:A');
xlswrite(strcat('D:\result_excel\AREA','.xls'),Area{i},1)
댓글 수: 0
채택된 답변
Image Analyst
2015년 4월 24일
In the loop, get the filename, extract the first column into the next column of a double array or a cell array that you are building up. Then when the loop exits, create an output filename and write out the data. The FAQ has code samples.
댓글 수: 0
추가 답변 (1개)
Star Strider
2015년 4월 24일
I would put the xlswrite call after the for loop rather than in it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!