merging excel files in another excel

조회 수: 1 (최근 30일)
antonet
antonet 2012년 5월 28일
Dear all,
I have some excel files, say sa.xlxs, sd.xlsx, vb.xlsx, ki.xlsx and so forth.
Is there any command for merging all of them in one sheet of another excel file such that the new sheet to contain first the sa.xlxs then sd.xlsx and so forth?
thanks
  댓글 수: 1
antonet
antonet 2012년 5월 28일
Any answer? Because I searched for any relevant tread but could not find anything.
Thank you again

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

채택된 답변

Oleg Komarov
Oleg Komarov 2012년 5월 28일
You have to use:
  1. [optional] list = ls() to list the .xlsx files. You can use wildcards.
  2. Import the files with xlsread()
  3. Concatenate the data. One of the function you might need to use is cat() or []. Or refer to the many See Also links in cat()
  4. Write output to excel with xlswrite()
Points 2-4 will usually loop on the list created with point 1 (or user supplied list)
  댓글 수: 2
antonet
antonet 2012년 5월 28일
thank you for oleg. to be honest I do not know how to concatenate the data or what "Points 2-4 will usually loop on the list created with point 1 (or user supplied list)" means. could you please be more specific?
thanks
Oleg Komarov
Oleg Komarov 2012년 5월 28일
Try points 2 and 4 for a specific file, then add another file (i.e. repeat point 2) then try point 3.
Once you're able to do it for a pair, you can add point 1. and try to write a for loop.
Also give a look here: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F

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

추가 답변 (0개)

카테고리

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