필터 지우기
필터 지우기

Problem with XLS files read and write

조회 수: 1 (최근 30일)
Maurizio
Maurizio 2011년 12월 7일
Dear All, I have a single file with a table of 8 column and 200 raw. I would like to create a function that open the XLS file and create 200 XLS files each one with the 8 value of each raw. Can somebody help me please? thanks a lot

답변 (1개)

the cyclist
the cyclist 2011년 12월 7일
Have you tried the xlswrite() and xlsread() functions?
EDIT in response to comment:
You provided no detail on what you have tried, or where you are stuck. Here is the general approach I would take:
-- Use xlsread() to read the origin file into a variable
-- Use a for loop that
  1. extracts each row of that variable
  2. creates a unique filename for each row
  3. writes that row to file using xlswrite()
Maybe you could take that approach, and see if you get stuck anywhere. If you do, then post your code and your specific question about where you are stuck.
  댓글 수: 12
Maurizio
Maurizio 2011년 12월 7일
how can I do please?
the cyclist
the cyclist 2011년 12월 7일
all(1,:) is the first row of the cell array, so it will be a 1xN cell array. You could try to do xlswrite{'fn',num2str(k),'.xls',all(1,:),'a1:u1'};
I'm not sure if xlswrite() works like that, and I cannot test it here.
If it is acceptable for you to have CSV files instead of XLS files as output, you could use the File Exchange function cellwrite(), available here: http://www.mathworks.com/matlabcentral/fileexchange/7363-cellwrite

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by