How to delete first 50 columns for input files with different data format?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello All,
I am a new user and this is my first time post.
I am trying to build a workflow where i need to delete the first 50 columns of my Input file. My input files will differ everyday and column headers wont be the same or will not be in same alignment hence the select/deselect field tools is not helping me when i tried because the workflow tried to locate the field name in my next input file.
See below example of what I am trying to say:
Lets say we are trying to build a workflow to delete first 5 columns of input file doesn't matter what the headers are just delete first 5 columns.
Input File 1:
Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 | Column 7 | Column 8 | Column 9 | Column 10 | Column 11 | Column 12 | Column 13 | Column 14 |
1 | 2 | 3 | 4 | 66 | 77 | 88 | 99 | 44 | 55 | 55 | 66 | 77 | 33 |
Output for File 1:
Column 6 | Column 7 | Column 8 | Column 9 | Column 10 | Column 11 | Column 12 | Column 13 | Column 14 |
77 | 88 | 99 | 44 | 55 | 55 | 66 | 77 | 33 |
Input File 2:
Column 7 | Column 8 | Column 9 | Column 10 | Column 11 | Column 12 | Column 13 | Column 14 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 |
88 | 99 | 44 | 55 | 55 | 66 | 77 | 33 | 1 | 2 | 3 | 4 | 66 | 77
|
Output for file 2:
Column 12 | Column 13 | Column 14 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 |
66 | 77 | 33 | 1 | 2 | 3 | 4 | 66 | 77 |
Please assist .
Regards
SK
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @skotian1289 I mocked up a workflow let me know what you think?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi skotian1289,
Welcome to the community.
There are a multiple ways to achieve this. I have used a dynamic input in my solution. I hope this is what you wanted. I had posted a solution before also but it did not take into account multiple rows and hence edited it again.
If this solves your issue please mark the answer as correct and also hit the like button, if not let me know! I've attached my workflow for you to download if needed.
Thanks,
Abhra Mitra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Joseph,
Thanks for your response.
I tried ur workflow but somehow all the deleted columns are appearing in the end and there are no values captured. Not sure if i am following the steps correctly.
Actually my data is very huge with 500 columns and thousands of values plus it is a Csv format. I cant share the actual data but i can give you a sample file attached.
Apologies for not providing sample file at beginiing.
Regards
SK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @skotian1289 I used your file to show how the workflow works and attached an Alteryx package so you can see how it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Joseph - Genius, i tried the workflow steps and it is working now. Thanks a ton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
An alternative solution would be to use the Dynamic Select tool using a "NOT IN" function and utilizing the available [FieldNumber] option in that tool:
Attached is an example that also has a small process to generate the numeric portion of the function so that you don't have to type out number's 1 - 50, but rather just copy and paste.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey,
I guess the shortest solution is to use the Dynamic Select Tool, switch it to "Select via Formula" and use the expression [FieldNumber] > 50.
Ferdinand
