How to take 2nd row as the header in to the new excel file

I have the data


the 2ndrow from Column B should be the header as sheet1=A2
same as that 3rd row from B should be the header as sheet2=A3

Hi @Jyothi1

Check the below thread

Regards

Hi @Jyothi1

Use Read range activity with range as A2 and select add headers option and use Write Range activity

Regards,

please provide any correct solution like row need to picked and write as header in new excel sheet

@Jyothi1

Can you try the below for 2nd row

NewDT=DT.AsEnumerable().Skip(1).Take(1).CopyToDataTable()

Input:

image

Output:

image

For 3rd row try below

NewDT=DT.AsEnumerable().Skip(2).Take(1).CopyToDataTable()

Note:

Make Sure Uncheck Add Headers option in both Read Range and Write Range activities

Cheers!!

@Jyothi1

you can use a copy paste range as well directly

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.