WinXP - script 2 find/remove str from file?

March 11, 2011 at 15:12:27
Specs: Windows XP
In a WinXP environment, I am looking for a script (or guidance on specific commands) that I can kick off when I need it (manually). The script should look in a file (same file every time) for a string(s) that I specify and IF they are there remove them and then save the file.

Example: File.txt contains AAAAAAAAAAACATAAAADOGAAAAAAAAAAAMONKEYAA and I want to end up with File.txt containing just AAAAAAAAAAAAAAAAAAAAAAAAAAMONKEYAA. CAT and/or DOG may or may not be in the file from run to run, and each may be anywhere in the file from run to run.

Suggestions on scripting languages and/or commands to look into?


See More: WinXP - script 2 find/remove str from file?

Report •

March 11, 2011 at 15:27:35
Wait - I lied - shoot. In addition to what I posted previously, I forgot to mention that in finding "CAT" for example, that is only part of the entire string I need to remove. So, in other words, I will always know the beginning of a chunk that I want removed, but not the rest of the line -- and worse yet, there are no line breaks in the file. I think (but don't know for sure) that all of the chunks I need to remove will always be one after another. Let's assume that they are -- I suppose I could assume the start of the second chunk is just after the end of the first chunk (which, again, runs longer than the part I know to search for) -- so I guess conceptually I could find and remove the first n-1 chunks, but what about chunk n (for which I don't know an ending delimiter)?

Report •
Related Solutions

Ask Question