简体   繁体   中英

Copy excel sheet data to another sheet using c#

In my excel sheet there are many cells filled with some information. eg sheet1

**Osdata**  
C:\Program Files (x86)  
Z:\Program Files\Google\Update  <br>
W:\Program Files (x86)\Internet Explorer\es-ES  <br>
C:\Program Files (x86)  <br>
q:\Program Files\Google\Update  <br>
W:\Program Files (x86)\Internet Explorer\es-ES  <br>
C:\Program Files (x86)  <br>
Z:\Program Files\Google\Update  <br>
P:\Program Files (x86)\Internet Explorer\es-ES  <br>
C:\Program Files (x86)  <br>
Z:\Program Files\Google\Update  <br>
X:\Program Files (x86)\Internet Explorer\es-ES  <br>
C:\Program Files (x86)  <br>
F:\Program Files\Google\Update  <br>
W:\Program Files (x86)\Internet Explorer\es-ES  <br>
**Files**   <br>
D:\MyFolder\Work    <br>
D:\PDF\Year\2016    <br>
E:\Games\Report\Tri <br>
E:\all\Reports\Like\12\P    <br>
D:\MyFolder\Work\32\WERT    <br>
D:\PDF\Year\2016\RET\12\ER  <br>
E:\Games\Report\Tri <br>
E:\all\Reports\Like <br>
D:\MyFolder\Work    <br>
D:\PDF\Year\2016    <br>
E:\Games\Report\Tri <br>
E:\all\Reports\Like <br>
D:\MyFolder\Work    <br>
D:\PDF\Year\2016    <br>
E:\Games\Report\Tri <br>
E:\all\Reports\Like <br>
**OthersData**  <br>
\\Games\AllGames\Data   <br>
\\Report\New\AllNew\Report  <br>
\\Re12\FERT\Like    <br>

now i want copy Osdata and Othersdata to sheet2. these all are sample data.

Okay, First of all you need to read the current excel data. use this link Read Data From Excel file using CSharp

Then, you will write the data you just read into another excel file. use this link Export Data to excel file

Hope this will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM