How to delete multiple empty columns in collection?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-09-17 07:32 PM
I have 1000 rows and 200 columns in excel sheet which I am copying into collection (using Get worksheet as collection).
Out of 200 columns, around 80 are empty. How should I delete those empty columns?
If I use 'delete column' action, it will ask for column name but I want delete all null columns in one go. Please suggest.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-09-17 10:28 PM
Use Collection Maipulation ""Get Collection Fields"" Action to get Column Names into a Collection.
Loop the Column Names Collection To find weather the Column is completely Empty using ""collection Contains Value"" Action
Get the output parameter from the ""collection Contains Value"" action and Make a decision if the output parameter is false then use the Action ""Delete Column"" to delete the particular row.
This Logic can be used for collection containing any number of columns.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-09-17 11:38 PM
I'd recommend reading the Excel file using an OLEDB query. That way you can actively select the columns you want and ignore the ones you don't.
Or in Excel, read across the first data row to identify empty columns for deletion.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-09-17 05:51 AM
Another option is to simply write a page in Excel VBO to get only the dataset with columns with values in. The UsedRange of Excel(used in Excel VBO) can have a larger area than the actual data Range.
