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

File Line by line Iteration

JR1
7 - Meteor

This question was asked before, but it did not seem to have a clear answer.  I want to be able to read in a file (one line at a time), run that line through a process, and then read in the next line.  So far I am able to read in just the fist line using a sample tool, run the process (with a block until done equipped), and then output the first row.  I am not sure how to go back and get the next row.  I have referenced this page, but the answer does not seem to be very clear.

 

Can I use a command tool, or an R tool to achieve this?

5 REPLIES 5
Joe_Mako
12 - Quasar

If we knew more about what you want to do and the context for why you feel the need to read one line a time, a better better fitted solution could be created.

 

The attached is based on what I am able to gather so far:

- Input to read the whole file in

- Record ID so each line is uniquely identified

- Use a Batch Macro, using RecordID as the Control GroupByField (the result being only one record will be passed into the macro for each run)

- Perform your operations on the one line inside the Macro workflow (I just have a formula tool placeholder)

 

use batch macro.png

batch macro.png

 

I could be misunderstanding your need. If that is so, can you please provide some sample data that represents your input file, and what you expect the output to be?

 

Thank you!

JR1
7 - Meteor

I have a file that has about a million records in it.  Inside the file there are two columns that need to be compared to each other.  The way I need to compare them is through a fuzzy match in order to obtain the match score between the two values.  I learned how to do this from a question I asked previously.  This method works great.

 

The problem I am facing is that it takes a long time to process the fuzzy match results because of the way the fuzzy match does comparisons.  I have not found any way to configure the fuzzy match tool to do a 1-to-1 comparison.  This is why I am trying to do the configuration so that one row is passed into the fuzzy match.

 

I have created the following macro for the fuzzy match comparison.  I need to pass only one row at a time through this macro rather than the whole file at once.

 

fuzzyloop.png

Joe_Mako
12 - Quasar

How about the attached?

 

- Because it is a Batch Macro and using the RecordID as the GroupBy, only one record will be processed by the macro at a time.

- In the macro, Transpose make the data tall, so there is one record for each field

- Fuzzy Match, configured similar to how it was in the other thread

- Append to combine the input data with the score

 

Batch Macro v2.png

JR1
7 - Meteor

This is exactly what I was looking for.  Thank you very much.

Melissa123
5 - Atom

Awesome!

 

Thanks a lot Joe, its working now 

Labels