Latif
November 10, 2020, 11:10am
1
HI,
My Excel file have 2 colums with same header and the file is generated form a finance system.
like.
Column C header is = “Item Type”
Column D header is also = “Item Type”
But the values in column C is number and value in columns D is description.
I can not read this file as preserve format how to solv this…
Act im reading the file first and save data to an output variable then i use the same output data to edit the columns names.
1 Like
Hi @Latif if the headers are same , then u can retrive values by using their rowindex
Lets say
Lets say Item Type having values in in first column and other in second
So First one had rowindex 0 and other had rowindex 1 so based on rowindex u can retrive values
like this
row(0).ToString like that
1 Like
Hi @Latif ,
you can use @NIVED_NAMBIAR , Method.
if your excel column indexs keep changing you can just refer the below method
so, you can change the column name and try like this dataTable.Columns(“Item Type”).ColumnName = “Description”
Now you can use different headers to fetch the details.
Cheers
@Latif
1 Like
Latif
November 11, 2020, 8:09am
4
thanks …
but i have still not solved this issue as its keep saying me the column name exist.
Hi @Latif did u tried by using rowindex method I specified ?
Hi @Latif if the headers are same , then u can retrive values by using their rowindex
Lets say
Lets say Item Type having values in in first column and other in second
So First one had rowindex 0 and other had rowindex 1 so based on rowindex u can retrive values
like this
row(0).ToString like that
Latif
November 11, 2020, 8:46am
6
First I read the file as preservformat and getting an output file.
Then I read the file again and doing 2 column name changes,
Now tell me what i do wrong and do i need to read the file and take an output file or not?