Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to create a File Layout of your final file?

jdelaguila
8 - Asteroid

Is there a way to create an Flat file XML layout with Alteryx?  Looking to create a flat file something like this:

 

<flatfile version="1">
<file
path="Filename.txt"
eoltype="crlf"
/>
<fields>
<field name="Field1" type="V_String" length="20"/>
<field name="Field2" type="V_String" length="1"/>
<field name="Field3" type="Double" length="19"/>
<field name="Field4" type="V_String" length="25"/>

</fields>
</flatfile>

 

Looking to create a Layout to send to the Client along with my final flat file everytime.  Not sure if Altyerx has a nifty tool that can do this.

Thanks!  Javier

2 REPLIES 2
dougperez
12 - Quasar

I don't know any of the tools to do that, but i would recommend to create a macro to do this... 
The basic data profile tool should have all this informations.

See the macro attached, I think that will solve your problem ^^

danilang
19 - Altair
19 - Altair

Hi @jdelaguila 

 

The tricky part here is that your Double field is 19 wide, but standard doubles are 8.  To get around this convert the double to a string with the size you need.  You can use an Output Data tool configured to write as .flat format

 

danilang_2-1626436753659.png

 

 

 

Your output will look like this 

 

danilang_1-1626434665308.png

 

If you need the 3rd column to be right justified, include a formula tool with PadLeft() adding spaces or zeros as required

 

To get the xml Layout file, use a Field Info tool on both the original and resized datasets and join these on name.  Build up the field info lines and concat them together.  Append this to the Header, which has the dynamic path in it and the footer.  Build and output the XML Layout file

 

Dan

 

 

Labels