I have a file with a set of alternating keywords and values for each main
key:

  mainkey  keyword value  keyword value  keyword value  etc.

For a certain set of main keys, I want to translate the values of several
keywords.  I'd like to avoid reformatting the whole file with SPLIT|JOIN,
so for now I've used a separate CHOP|XLATE|GATHER|JOIN for each one:

  (end /) ...
    | suf: chop after string " IXBTSUF " | newsuf: gather | join 1
    | mod: chop after string " IXVMOD "  | newmod: gather | join 1
    | mac: chop after string " IXVMAC "  | newmac: gather | join 1
    ...
    / suf: | xlate w1 ... | newsuf:
    / mod: | xlate w1 ... | newmod:
    / mac: | xlate w1 ... | newmac:

Obviously, this is no good if these keywords may also appear as values,
and it gets messy fast if the list of keywords is long or variable.  I
feel like I must be overlooking some simpler and more reliable approach.

¬R

Reply via email to