search & replace in a table view

i have a search and replace script which works like this:

it takes the values of one row in the first column and searches for them in all documents that are in a specific folder. it the replaces in all the instances where it has found the words from the first columns row, with the words in the second columns first row.

how would i repeat it for each row?