Hi everyone,
I would appreciate the help for this issue I am facing.
Currently I want to copy the data from certain column in an Excel file. And bring it over to a CSV of a different template. I want to copy the data start from row 13,14,15,etc. and below as long as there is data.
If this info helps, Row 10 has unique column name to it.
The column I am interested are marked in green circle.
I wanna be able to populate this data to a csv file as below:
IMO to IMO. SHIPNAME to SHIPNAME etc.
What I have done is:
-
I try reading the excel file from range “A13:V30” as falls in the range of the data I want:
-
Read the CSV template:
-
I try assigning variable for each row:
IMO = DT_file9_data.Rows(0)(0).ToString.Trim
SHIPNAME = DT_file9_data.Rows(1)(0).ToString.Trim
etc. as per below:
-
I would add data row using Array Row:
-
And write the datatable to CSV:
But it gives this wrong Output instead:
I appreciate the help. Thank you in advance.