URL Conversion

Discussion in 'other software & services' started by waldets, Aug 12, 2008.

Thread Status:
Not open for further replies.
  1. waldets

    waldets Registered Member

    Joined:
    May 7, 2008
    Posts:
    6
    I need some help please.

    I have a list with URLs including addresses with subdomains, and now i want to remove all the subdomains from the list. Does someone know a tool or a trick to do this automatically? I'm on windows xp-sp3.
     
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    9,316
    In what format is this list?
    Mrk
     
  3. waldets

    waldets Registered Member

    Joined:
    May 7, 2008
    Posts:
    6
    it's a txt-file with one domain per line, and every domain starts with http://
     
  4. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    9,316
    Hello,

    Then open it in a good text editor like notepad++. Then, use its find + replace function, which is very powerful and supports regular expressions.

    You can then specify that you want to replace:

    Find: something.com[0-9][a-z][A-z]*.

    Replace: something.com

    This is just a crude example, but this will remove anything alpha-numerical beyond something. And if you have dots, dashes etc, then you can simple use the *. wildcard, which "means any number of any characters."

    Mrk
     
  5. waldets

    waldets Registered Member

    Joined:
    May 7, 2008
    Posts:
    6
    Thank you very much for the help, Mrkvonic!
     
  6. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    9,316
    Hello,
    You're welcome!
    Cheers,
    Mrk
     
Loading...
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.