This seems very easy but I’m having a hard time how to trim the column names in my datatable.
First I’m reading the excel file and saves it to my dt variable
Then I’m assigning each column names in a variable
Now, I’m having an error because it’s looking for “Customer Name” but in my reference excel file the column name look like this " Customer Name " with extra spaces.
What I’m doing is to copy the ID and Name to the destination excel in column Customer Name and Customer ID. I already did this part. The only problem is how to trim extra space in my reference excel column name. Since if there are extra spaces in the reference excel I’m getting an error.