Seperate excel columns INTO one datatable

image
hi, how can i extract seperate excel columns into one datatable? pic as above.

Can you clear the inquiry please! do you mean you want to exctrac the column c into different data table ? @pitaty

cheers :smiley:

Happy learning :smiley:

@pitaty

  1. use Read Range activity to read the data from excel file and will give you output as DataTable and say ‘inputDT’.

  2. And then below expressions to separate required columns from DataTable.

     newDT = inputDT.DefaultView.ToTable(False,"Name","Age","Sex")
    
  3. And then use Write Range activity and pass newDT write into Excel file.

i want to extract column “A,B,D” into one datatable.

Works. Thank you !

image
what’s this meaning? i wrote as the same as you mentioned :
image
Please help

@pitaty

Here dt variable is of type System.Data.DataTable or not ?

yes. dt is of type System.Data.DataTable