help with a batch find and replace
Posted: Fri Oct 27, 2006 11:11 pm
Hi
I have a folder containing 400 text files which I want to search for particular text. If this text is not found, I want to replace a different set of text with another word.
So I'll give you a three line example. Note that the following text each occurs within a much longer line of text which cannot be broken up.
Line 1. ALABASTRON, ITALY, ORVIETO, -525
Line 2. KRATER, -550
Line 3. AMPHORA A, RHODES, CAMIROS, -550
I want to search for (ITALY, ORVIETO, -) OR (RHODES, CAMIROS, -) Etc. etc.
and if these are not found then replace the , - with , NULL, -
I am seeking to use the , - (comma space hyphen) because this is the only regular occurance in the data. If the , - (comma space hypen) is NOT interrupted by any text which appears in my list, then I want to replace it with , NULL, - (comma space NULL comma hypen).
If it makes any difference there are about 40,000 lines in all, and about 1700 possible place names. I have entered these into Advanced Find And Replace without any difficulty, but I don't know how to tell the program to do the above.
How do I do this?
I have a folder containing 400 text files which I want to search for particular text. If this text is not found, I want to replace a different set of text with another word.
So I'll give you a three line example. Note that the following text each occurs within a much longer line of text which cannot be broken up.
Line 1. ALABASTRON, ITALY, ORVIETO, -525
Line 2. KRATER, -550
Line 3. AMPHORA A, RHODES, CAMIROS, -550
I want to search for (ITALY, ORVIETO, -) OR (RHODES, CAMIROS, -) Etc. etc.
and if these are not found then replace the , - with , NULL, -
I am seeking to use the , - (comma space hyphen) because this is the only regular occurance in the data. If the , - (comma space hypen) is NOT interrupted by any text which appears in my list, then I want to replace it with , NULL, - (comma space NULL comma hypen).
If it makes any difference there are about 40,000 lines in all, and about 1700 possible place names. I have entered these into Advanced Find And Replace without any difficulty, but I don't know how to tell the program to do the above.
How do I do this?