I have an excel having 88 columns. Need to delete some columns from there if that specific column doesn’t belong to an array of strings (header values).
Q1. By knowing the column name (that it doesn’t belong to the array) how can we find the cell value of that header ?
Or please let me know what is the other way of deleting the columns while traversing through the header values ?
Hi
Did we try with REMOVE DATACOLUMN activity where we can pass the column name as input
like pass the array variable with column name as input to a FOR EACH activity and change the type argument as string
–inside the loop use a REMOVE DATACOLUMN activity and mention the input as item.ToString in column name property and mention the datatable name in datatable property
I am not using data table. Want to do directly on excel. So if i use delete column activity of excel i have to pass column no. which i can get by index of header array but once a specific column is deleted it will shift and the counting will change and won’t be in sync with the position no of the array. So it will delete the wrong columns next time.
Note: The excel file contains more than 3.5 lakhs of rows. So reading and writing from data table will be good ??
This would be very good i guess. But i have a question. For large excel file like having 350000 records, will it be a good way to use data table or there is any better way to do this ?
Hmm one more simple option is just a ASSIGN ACTIVITY like this
—once after getting the datatable from READ RANGE activity we can keep the columns we want with this expression
Hello @Palaniyappan , yes your option is actually good, and i use it as well. Altough when i began i found it more easy to use the “FilterActivity” and only later on did i move to your solution.
@kkpatel, i only had problems with files with large columns without the excel application scope (it would be excruciatingly slow), using it i never had any problems (other than those inerent to the Excel handling big files , :))
@lfcosta@Palaniyappan As my file contains more than 300000 records its not even executing the read range activity. The execution is absolutely stopped also not giving any error. I am not getting any clue what is happening in the background.
@Palaniyappan I tried through the read range under workbook. There i provided the full path, my file is csv not xlsx. So it gave me exception that .csv is not supported.
But in excel application scope it was not throwing any error for the .csv file.