In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Block Report Fixed Width Parsing

GarthWest
5 - Atom

Hey y'all,

 

I am trying to import a file that has a title line then a report in blocks of 5 rows with 5 unique fixed width patterns.

 

GarthWest_0-1642723528536.png

 

I would like to parse it all out into a table where each block is a single row. I understand how to import and add names and types with a regular fixed width txt, but the line breaks have me stumped. Any ideas?

 

Thanks!

West

4 REPLIES 4
GarthWest
5 - Atom

Oh the widths are:

 

Header
row one: 3, 3, 3, 7, 9, 9, 7, 20, 1, 7, 8, 3, 3, 3, 1, 9, 15, 15, 8, 8, 2, 9, 1, 1, 1, 1, 1, 5
row two: 3, 3, 9, 9, 3, 3, 9, 30, 15, 1, 15, 15, 3, 1, 13, 9, 1, 1, 1, 1, 9, 1, 4, 1
row three: 3, 3, 4, 7, 11, 26, 20, 1, 8, 9, 17, 1, 1, 7, 11, 11, 4, 4, 8, 4
row four: 3, 3, 13, 11, 2, 40, 7, 7, 15, 9, 1, 10, 10, 20, 9, 8, 1, 4
row five: 3, 3, 7, 11, 20, 9, 5, 20, 20, 20, 17, 1, 2, 15, 7

 

Thanks again!

Watermark
12 - Quasar
12 - Quasar

Garth, 

 

See attached.   If I understood correctly, you're effectively wanting to combine the 5 lines into 1 single line. 

 

If this works, please hit the solution accepted. 

 

Mark Thompson

Watermark Data

GarthWest
5 - Atom

Mark,

 

Thanks for this and sorry for the very slow reply! Yes, that is part of it. I also need to split that new row into around 95 columns. Currently, I have a workflow doing that in reverse order that has five different input tools with five different fixed widths connected to the same file. 

 

Each of those then go through a select records tool to pull the row relevant to the fixed width, then a record ID tool so I can join them back together in a single row:

 

GarthWest_0-1644429317503.png

However, I prefer the tidiness of your solution. Any insight on how I would break out the data of that single resultant column without using 95 different text to column tools?

 

Thank you again

 

GarthWest
5 - Atom

Never mind. I just took the RegEx lesson👨‍🎓

Labels
Top Solution Authors