cluelesspanda
Programmer
I'm tring to do search & replace with tcl. I have 2 files, one with search key and its corresponding replacement value, and a target text file. The file with key/value is simple - it has key/values space delimited in 2 colums:
ex. (first element is the key, 2nd is the replacement)
blue black
red yellow
white green
The target text file is just text like this: ("xxx".. is just irrevant text)
xxx xxx xxxxx xxxx
xxx blue xxxxx aaaa - where "aaaa" is replaced with "black"
xxx red xxxxx bbbb - where "bbbb" is to be replaced with yel
etc.
does anyone have an efficient elegant way to do this? thanks!!
cia,
clueless in class
ex. (first element is the key, 2nd is the replacement)
blue black
red yellow
white green
The target text file is just text like this: ("xxx".. is just irrevant text)
xxx xxx xxxxx xxxx
xxx blue xxxxx aaaa - where "aaaa" is replaced with "black"
xxx red xxxxx bbbb - where "bbbb" is to be replaced with yel
etc.
does anyone have an efficient elegant way to do this? thanks!!
cia,
clueless in class