[METHOD]Removing line numbers and white space from url lists

Pekton

Regular Member
Joined
Nov 28, 2009
Messages
250
Reaction score
106
I've been getting backlinks txts from xrummer campaigns to then run through RSS , ping etc. They always come with line numbers and an empty line in between. Been a right pain in the arse removing both manually.

Found an easier way using regular expressions

I use programmers notepad 2 for formatting and found this works best with these expressions http://www.pnotepad.org/

open your file and then Select Search>Replace short cut ctrl +H

In the Find box put
Code:
[0-9][ \t]+
and in the Replace box put a single space. The space is very important. Click replace all. What it does is it will search for every single digit that is followed by a space and replace both with a space. You will need to run it several times to remove line numbers that have more than one digit.

Once all the line numbers are gone open up search/replace again and this time use
Code:
^[ \t]+|[ \s]+$
in the Find box and make sure there's is nothing in the replace box (the space from the last search many still be there so check and delete it)

Replace all now will get rid of your excess white space and empty lines. All set with a nice clean url list

Always remove the numbers first before the white space and remember UNDO is your friend

For some reason I can only get the white space expression to work properly in programers notepad. Maybe any regular expression gurus would know why?
 
Last edited:
Back
Top