Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Expand Delimited Files Macro

John_Doe101
6 - Meteoroid

Hello, community,

 

This is more of a contribution than an issue.

My job role includes having to expand (parse) delimited files to a fixed format and creating a layout for that new fixed file. We've done that in the past with a CMD program that's very effective but not that efficient since it takes hours to expand large files, sometimes days. I'm talking about tens of millions of records. The issue I've run into using Alteryx it's it assigns a predetermined length to all fields when loading delimited files, and I know you can change that in the input, but again it affects all columns. I also know I can change each column manually with a Select tool, but again that's not very efficient when running 50 files a day. Using an Autofield tool doesn't help either since it changes the field types, and I need them all to be strings. 

So I came up with a solution I've created in a macro, which reads the file and expands each field to the max data length, keeps the data as a string and writes a layout. In my case, I need the files in txt format, but if you need a different format then you can tweak the macro to meet your needs. I added the option to round up the length of the fields to the nearest fifth also. 

Pretty sure you might have better solutions for this. I hear any comments.

2 REPLIES 2
joshuaburkhow
ACE Emeritus
ACE Emeritus

Oh! Nice. I am checking this sucker out now. Sounds amazing. 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
John_Doe101
6 - Meteoroid

Cool! Let me know what you think.

Labels