필터 지우기
필터 지우기

I want to combine only first column of first and second excel file to make 1 excel file (save individually as 1.xlsx) and then second column of first and second excel file to make another excel file as 2.xlsx.

조회 수: 1 (최근 30일)
Hlo
First excel file
1 2 3
1.1 2.2 3.3
80 90 91
Second Excel file
4 5 6
4.4 5.5 6.6
88 87 86
I want to combine only first column of first and second excel file to make 1 excel file (save individually as 1.xlsx) and then second column of first and second excel file to make another excel file as 2.xlsx.
Can someone help me to solve this problem.
  댓글 수: 2
Bob Thompson
Bob Thompson 2019년 12월 19일
This should be fairly easy to do using xlsread and xlswrite.
What do you have so far for your code? Are you stuck on the commands to use, or is there a more specific error you keep running into?

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

채택된 답변

ariel gerber
ariel gerber 2019년 12월 19일
%% read1
file1='file11';file2='‏‏file12';
N=256;
col1=xlsread(file1,1,strcat('A1:A',num2str(N)));
col2=xlsread(file2,1,strcat('A1:A',num2str(N)));
Data1=[col1,col2];
%% read2
col1=xlsread(file1,1,strcat('B1:B',num2str(N)));
col2=xlsread(file2,1,strcat('B1:B',num2str(N)));
Data2=[col1,col2];
%% write
xlswrite('1.xlsx', Data1);
xlswrite('2.xlsx', Data2);

추가 답변 (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