フィルターのクリア

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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by