Read excel column and write in another excel by its headers


#1

TEMPLETE (A).xlsx (8.5 KB)
updated.xlsx (40.5 KB)
HI Developers,
i have an template file in which as per the headers i need to read the data columns from the updated file and write into the template, but in my case headers are at A2, B2 , C2 like that

please find the attachment’s FYI

please provide me the logic @arivu96


#2

Hi @lalithya14,

store this value in one array value
arrHeaders={"APNO","APLAN","ASTSD","AINSNM","PADR1","PADR2","PADR3","PADR4","PTEL1","PTEL2","POWNER"}

then use Read range activity to read the updated.xlsx file and get the output as datatable(dtMainTable)

dtMaintable=dtMaintable.Defaultview.ToDataTable(False,arrHeaders)

So you will get the filtered datatable alone.

Regards,
Arivu


#3

IN ARRAY IF ANY OF THE HEADER IS EMPTY
arrHeaders={“APNO”,“APLAN”,“ASTSD”,“AINSNM”,“PADR1”,“PADR2”,“PADR3”,“PADR4”,“PTEL1”,"
“,“PTEL2”,“POWNER”}
IN ARRAY IF I GIVE {” “.“APNO”,“APLAN”,” "} I AM getting an error , in my template i have empty columns , and again some plan codes
please go through my template for the information TEMPLETE (output).xlsx (17.4 KB)
TEMPLETE.xlsx (8.6 KB)
Please check the template output, is different from the template , so i my question is how to insert the empty columns in array of strings :sweat_smile:

Thanks in advance,
@arivu96