Peter,
I see. You need to read the search and replacement strings from a file, rather than typing them from keyboard.
Here is a simple macro that does that:
// Multi Replace
// - Replace multiple strings. Read strings from file replace.lst.
#20 = Buf_Num // original buffer
#21 = Buf_Free // list of replacement strings
Buf_Switch(#21)
File_Open("replace.lst", NOMSG+OVERWRITE+NOEVENT)
BOF
repeat(ALL) {
#1 = CP
Search("|S", ERRBREAK)
RCB(10,#1,CP) // treg 10 = search string
Search("|!|S", ERRBREAK)
RCB(11,CP,EOL_pos) // treg 11 = replace string
Line(1)
Buf_Switch(#20) // switch to original buffer
BOF
Replace(@10, @11, ALL+NOERR)
Buf_Switch(#21) // switch to list of strings
}
Buf_Quit(OK)
Buf_Switch(#20)
It reads the search and replacement strings from the file "replace.lst" (you can change the name). Each line of replace.lst must contain two words: the first one is the search string, the second one is the replace string. Example:
1000 aaa
2000 bbb
2100 bcc
2200 bdd
3000 ccc
You could use comma or other special characters to separate the strings instead.
Also, you may need to do some more checking, in case the replace.lst file contains other lines or characters that need to be filtered out.
-- Pauli