replace everything after a particular character

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

mcfillen
Posts: 1
Joined: Fri Aug 22, 2003 4:43 am
Location: Tulsa, OK USA

replace everything after a particular character

Postby mcfillen » Fri Aug 22, 2003 4:51 am

I have read the FAQ on how to replace everything after a particular character but still don't get it. I am trying to delete all of the text after a pattern (cleaning up URL's for spam filter lists). How would I delete everything after the .COM in:

http://www.domain.COM/example/index.htm

jring
Posts: 18
Joined: Tue Sep 23, 2003 3:13 am

Easy one!

Postby jring » Tue Sep 23, 2003 9:14 am

http://www.domain.COM/example/index.htm

OK this is a few steps, but this works really well:

1. Search Replace Exact:
S: http://
R: http%%%

2. Search Replace Exact:
S: /
R: <carriage return>

3. Search Replace Exact:
S: http%%%
R: http://

4. Extract URLS.
5. Remove Blanks from begginning line.
6. Remove Blanks from end of line.
7. Remove Blank lines.

If you are working with very large files, you will bump into situations where this doesn't work, and will need to refine your strategy. However, this will definitely get you off the ground.

J-


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 2 guests