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?
Solved! Go to Solution.
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)
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!
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.
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
This is exactly what I was looking for. Thank you very much.
Awesome!
Thanks a lot Joe, its working now