# Processing text files

**URL:** https://www.finalbuilder.com/forums/t/processing-text-files/2165
**Category:** Discussion
**Created:** [June 19, 2013, 6:26am UTC](https://www.finalbuilder.com/forums/t/processing-text-files/2165 "2013-06-19T06:26:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fubnuts](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/439d5e/32.png) [@fubnuts](https://www.finalbuilder.com/forums/u/fubnuts)
#### Post date: [June 19, 2013, 6:26am UTC](https://www.finalbuilder.com/forums/t/processing-text-files/2165/1 "2013-06-19T06:26:22Z")

</div>

Hi,

I'm very new to FinalBuilder 7 so this may be a dumb question but here goes anyway:

As part of my product build I need to run a whole load of SQL statements in a particular order. The way we've done this is to have an @order.txt file in each folder which tells our current application what order to process the files in.

The file in the root folder contains the names of the folders that we need to process.

So I've created a "Read Text File" action that parses the folder list. What I need to do now is for each entry I need to then run another action that will:

1. Open the @order.txt file in the folder that is being processed;

2. Read the lines and execute the SQL script \<-- this bit I can do using the OnReadLine event.

&nbsp;

The problem I'm having is that I can't figure out how to create the second action that will take an input from the first action and process - and do this until there are no rows left in the first action. If that makes any sense at all?

Any help would be greatly appreciated.

Cheers,

Dan.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 20, 2013, 12:24pm UTC](https://www.finalbuilder.com/forums/t/processing-text-files/2165/2 "2013-06-20T12:24:54Z")

</div>

You can use a List Iterator action to process the lines, so Read Text File into a variable, the List iterator with the list of items set to %yourvariable% where yourvariable is the variable you read the text file into. Then place any actions you want to execute on each line as children of the iterator action.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [June 20, 2013, 12:27pm UTC](https://www.finalbuilder.com/forums/t/processing-text-files/2165/3 "2013-06-20T12:27:36Z")

</div>

I have attached a simple example.
