Add composer if title matches from text file?

Here comes a more generic version of a lookup action:

mta file: Lookup.mta (794 Bytes)
sample input file: Lookup.txt (215 Bytes)

The input file must be a normal text file of following format (first and last line empty, unique entries):

@CR@LF
Lazybones|Hoagy Carmichael@CR@LF
P.S. I Love You|Gordon Jenkins@CR@LF
Goody Goody|Matty Maineck@CR@LF
I'm an Old Cowhand from the Rio Grande|@CR@LF
Hooray for Hollywood|Richard A. Whiting@CR@LF
Too Marvelous for Words|Richard A. Whiting@CR@LF

"@CR@LF" stands for the unvisible CarriageReturn-LineFeed sequence at end of each line of text.

This is the lookup table.
The pipe symbol "|" is used as a delimiter between the two columns "search item|result item".
@CR = $char(13), @LF = $char(10), | = $char(124)

Changing the view a little bit our lookup table looks like:

@CR
@LFLazybones|Hoagy Carmichael@CR
@LFP.S. I Love You|Gordon Jenkins@CR
@LFGoody Goody|Matty Maineck@CR
@LFI'm an Old Cowhand from the Rio Grande|@CR
@LFHooray for Hollywood|Richard A. Whiting@CR
@LFToo Marvelous for Words|Richard A. Whiting@CR
@LF

Each row opens with the @LF symbol as the begin-of-row marker and closes with the @CR symbol as the end-of-row marker.

Finding a title is easy, just search for a string of "$char(10)%TITLE%$char(124)"
Additional scripting returns the corresponding string from the result column.

DD.20071123.1656.CET

Lookup.txt (215 Bytes)

Lookup.mta (794 Bytes)