Delete empty column without header reference


#1

BEFORE
image

AFTER
image


#2

@shruti, Follow these steps,

  1. Read Range - Read excel output to dt datatable.

  2. Assign - Get all column names that has empty rows

Paste the query right hand side and assign it to arr (String Array)

(From col In dt.Columns.Cast( Of System.Data.DataColumn)
Where dt.AsEnumerable().All(Function(x) x.IsNull(Convert.ToString(col.ColumnName)))
Select col.ColumnName).ToArray()

  1. For each - Loop through array with column Names and remove that column from dt

For each item in dt
in body use Remove data column activity set the columnName (item)

Regards,
Dominic :slight_smile:


#3

is this you told if so, column is not deleting


#4

@Dominic
If you will read excel which is having empty columns at the beginning and at the end. then it is fine.
but if empty columns will come between then you will get default column names like column n (where n will be numbers starting from 0,1,2… so on… and so on.

Note - ignore my comment just missed the part to read all empty rows :stuck_out_tongue:

Regards,!!
Aksh


#5

@shruti, Can you post the before and after pics what you are getting now ?

Tested from my side its working as expected !

Regards,
Dominic :slight_smile:


#6

Done bro :slight_smile:

Regards,
Dominic :slight_smile:


#7

no changes in excel sheet


#8

Can you share your xaml file


#9

@shruti, Its really surprising ! I think you have implemented everything perfectly.

Finally confirm your data variable type (it should be a string array).

Note: I couldn’t upload my Xaml due to security concern, else I would have done it before !

Regards,
Dominic :slight_smile:


#10

yes it’s string only :frowning:
okay i will check it once again Thank you


#11

@shruti

find the attached sample for u - Shruti sample.xaml (10.1 KB)

Regards…!!
Aksh


#12

@aksh1yadav, May I know why it wasn’t working before ? Any ideas ?

Regards,
Dominic :slight_smile: