Page 1 of 1

Edit text files - newbie question

Posted: Thu Mar 06, 2008 1:57 pm
by somervib
Hello,

I've checked through the forum but couldn't find an example of how to remove all but certain characters in multiple files. Here is an example of what I am working with:

325\250.9.98.45.ini(2): 250.9.98.45

Here is what I would like it to look like:

250.9.98.45

I have about 950 files all with this 1 line in which I was able to extract out and create a single file for simplicity and backup.

Again, newbie question so thanks for the help.

Brian

Posted: Thu Mar 06, 2008 4:02 pm
by Bob Hansen
Use Regular Expressions in Search/Replace:

Search for: ^.*: (.*)
Replace with: \1

==========================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------

You can do the replace in all open documents.
You can open multiple documents by starting TextPad calling a list of files to open: textpad.exe @filename

This will open all the files that are listed, one per line, in the specified file.