Deleting after text to the end of the line.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
kingliness
Posts: 3
Joined: Fri Mar 21, 2008 4:45 pm

Deleting after text to the end of the line.

Post by kingliness »

I downloaded TextPad and WildEdit.

Not sure how to do this.

I want strip urls.

Like this www.example.com/
www.example.net/file/one.html

I want to strip it to just www.example.com or www.example.net or www.example.org getting rid of all the information on the LINE following it.

So that my output should be a nice neat line of root urls.

Thanks.
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

I'm not sure this is completely straightforward. Do you need handle URLs of the form http://slashdot.org or www.google.co.uk?

Could you post a bigger sample?
Running TextPad 5.4 on Windows XP SP3 and on OS X 10.7 under VMWare or Crossover.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

For your examples, removing everything to the left of the first "/":

Search for: (www\.[^/]*).*
Replace with: \1

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
kingliness
Posts: 3
Joined: Fri Mar 21, 2008 4:45 pm

Post by kingliness »

www.youtube.com/results?qdebt+consolida ... &san&tabw1
www.3debtconsolidation.com/
moneycentral.msn.com/investor/calcs/n_debt/main.asp
moneycentral.msn.com/content/savinganddebt/managedebt/p36230.asp
www.careonecredit.com/
www.mydebtconsolidationadvice.com/
www.debtconsolidationcare.com/
www.budgetplanners.net/
www.debtconsolidation.com/
www.outtadebt.com/
en.wikipedia.org/wiki/debt_consolidation
www.youtube.com/results?qdebt+consolida ... &san&tabw1
www.mortgageloan.com/debt-consolidation
www.debtconsolidationunion.com/
www.bankrate.com/brm/news/cc/20031007a1.asp
www.nodebttoday.com/
www.finweb.com/debt-consolidation/
www.ftc.gov/bcp/conline/pubs/credit/kneedeep.shtm
www.secureloanconsolidation.com/credit_card_debt
www.secureloanconsolidation.com/
www.daveramsey.com/the_truth_about/debt ... 5.html.cfm
www.lendingtree.com/smartborrower/debt- ... ation.aspx
www.youtube.com/results?qdebt+consolida ... &san&tabw1
www.debtinsider.com/
www.debtconsolidationconnection.com/
www.elimadebt.net/
www.cleardebtsolution.com/debt-consolidation.php
https://www.debthelp.com/
www.rebuild.org/debt-consolidation.html
www.consumercredit.com/
www.debtco.org/
www.creditloan.com/debt-consolidation/
www.adshq.org/
www.youtube.com/results?qdebt+consolida ... &san&tabw1
www.circledebt.com/
mortgages-mall.com/
https://www.credit.com/ufg/credit.com/mortgage_index
www.theonion.com/content/news/u_s_takes ... solidation
www.delraycc.com/
www.newstepsolutions.com/
www.spendonlife.com/dc/
www.help-consolidate-debt.com/
www.finance.cch.com/sohoapplets/consolidate.asp
www.nowgetloan.com/debtconsolidationloan.php
www.youtube.com/results?qdebt+consolida ... &san&tabw1
www.bestdebtservices.com/
financial.wellsfargo.com/
www.smackdebt.com/
https://www.debthelp.com/debt-consolidation/
loanconsolidation.ed.gov/
www.surfinthespirit.com/debt-consolidation/
www.mortgage101.com/partner-scripts/1179.asp?pmtg101
ezinearticles.com/?catfinance:debt-consolidation
www.kimberlycredit.com/
www.christianet.com/debtconsolidation/index.htm
www.debtconsolidation.com/
www.debt10.com/
www.creditadvisors.org/
www.budgetplanners.net/
www.mydebtconsolidationadvice.com/
www.debtconsolidationloan.com/
www.credit.com/products/debt/
en.wikipedia.org/wiki/debt_consolidation
www.debt-consolidation-debt-reduction-debt-help.com/
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.careonecredit.com/
www.secureloanconsolidation.com/
www.debtconsolidationunion.com/
www.debt-settlement-america.com/
www.debtsettlementusa.com/
www.debt-consolidation.net/
www.forbes.com/debt_consolidation_loan.html
www.debt-consolidation-overnight.com/
www.usadebt.org/?adid2
www.libertydebtconsolidation.com/
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtreductionservices.org/
www.3debtconsolidation.com/
debtquotes.com/
www.debtconsolidation-credit.com/
www.usadebtconsolidation.net/
www.christiandebtconsolidation.org/
www.american-debt-consolidation-loans.com/
www.creditcounseling.net/
www.debtconsolidationloan.com/p_debt_consolidation.aspx
www.debtconsolidationams.com/
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debt10.com/debtc.html
www.debtbusterloans.com/
www.freedebtconsolidation.com/
www.axiomdebtconsolidation.com/
debtconsolidation-now.com/
www.debtfreeamerica.com/
www.debthelp.com/
www.debtconsolidationandmortgages.com/debt/maine.asp
www.debtcounselingcorp.org/
www.debt-consolidation-tips-and-tricks.com/
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtconsolidationagencies.com/
www.debtconsolidationloanscentral.com/
debtconsolidation.com/home.aspx?ses&kbid&kw?1011
helpdebtrelief.com/
www.adviceonline.co.uk/debt/
www.kimberlycredit.com/
indianadebtconsolidation.com
www.creditsolutions.com/
www.cleardebtsolution.com/debt-consolidation.php
www.debt-consolidation-diva.com/
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtconsolidationcare.com/
en.wikipedia.org/wiki/debt_consolidation
www.bankrate.com/brm/news/cc/20031007a1.asp
www.debt-settlement-america.com/
moneycentral.msn.com/content/savinganddebt/managedebt/p36230.asp
www.daveramsey.com/the_truth_about/debt ... 5.html.cfm
www.adelphia.net/google/index.php?&qsit ... solidation
www.forumup.us/?mforumdebtconsolidation
www.ftc.gov/bcp/conline/pubs/credit/kneedeep.shtm
www.usbank.com/cgi_w/cfm/personal/produ ... dation.cfm
www.bankrate.com/brm/news/debt/debtmana ... ngers1.asp
www.mortgage-calc.com/debtconsolidation/index.html
www.mortgage-calc.com/debtconsolidation ... lator.html
businessmajors.about.com/od/studentfinances/a/debtconsloans.htm
www.lendingtree.com/smartborrower/manag ... -plan.aspx
www.consumercredit.com/
groups.google.com/group/debtsolutions/web/debt-relief-how-to
www.debtconsolidationcare.com/benefits.html
https://www.credit.com/r/debt-consolida ... solidation
www.debtconsolidationunion.com/
financial.wellsfargo.com/
www.daveramsey.com/
www.mortgage101.com/calculators/debtcon ... sp?pmtg101

This is the sample size.

I only want:
domain.com
domain.org
domain.net
etc.

So I need to remove the http:// www. and everything after .com/.net/.org/ (depending on the domain extension)

I tried the syntax I was given by Bob in both TextEdit and WildEdit. - TextEdit didn't find the expression and WildEdit deleted everything.

I'm new to using these syntaxes and I'm only doing it for an automated solution!

Thanks
C.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Step 1: replace https?:// by nothing
Step 2: replace /.* by nothing

This should leave you with the host names.

Now what do you want to keep?
Toplevel-Domain plus second-level-domain?
What about third-level-domains - in many cases www, but in your examples are some other cases (e.g en.wikipedia.org)?

should www. at the beginning always be removed?
(e.g. www.org)?

Should all third-level-domains be removed (as in example.co.uk)? Not in every Toplevel-domain is the second level the "user" level ...
gitmo
Posts: 1
Joined: Wed Mar 26, 2008 8:55 pm

This should work

Post by gitmo »

1. REPLACE .*www. with nothing.
2. REPLACE /.* with nothing.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Ny suggestion was using TextPad, not TextEdit, and provided results you asked for in your example, with the leading "www...." stuff. Have no idea why it did not work for you. Did you set Regular Expressions ON, and use POSIX?

On the new sample you proviced I ended up with:
www.youtube.com
www.3debtconsolidation.com
moneycentral.msn.com/investor/calcs/n_debt/main.asp
moneycentral.msn.com/content/savinganddebt/managedebt/p36230.asp
www.careonecredit.com
www.mydebtconsolidationadvice.com
www.debtconsolidationcare.com
www.budgetplanners.net
www.debtconsolidation.com
www.outtadebt.com
en.wikipedia.org/wiki/debt_consolidation
www.youtube.com
www.mortgageloan.com
www.debtconsolidationunion.com
www.bankrate.com
www.nodebttoday.com
www.finweb.com
www.ftc.gov
www.secureloanconsolidation.com
www.secureloanconsolidation.com
www.daveramsey.com
www.lendingtree.com
www.youtube.com
www.debtinsider.com
www.debtconsolidationconnection.com
www.elimadebt.net
www.cleardebtsolution.com
https://www.debthelp.com
www.rebuild.org
www.consumercredit.com
www.debtco.org
www.creditloan.com
www.adshq.org
www.youtube.com
www.circledebt.com
mortgages-mall.com/
https://www.credit.com
www.theonion.com
www.delraycc.com
www.newstepsolutions.com
www.spendonlife.com
www.help-consolidate-debt.com
www.finance.cch.com
www.nowgetloan.com
www.youtube.com
www.bestdebtservices.com
financial.wellsfargo.com/
www.smackdebt.com
https://www.debthelp.com
loanconsolidation.ed.gov/
www.surfinthespirit.com
www.mortgage101.com
ezinearticles.com/?catfinance:debt-consolidation
www.kimberlycredit.com
www.christianet.com
www.debtconsolidation.com
www.debt10.com
www.creditadvisors.org
www.budgetplanners.net
www.mydebtconsolidationadvice.com
www.debtconsolidationloan.com
www.credit.com
en.wikipedia.org/wiki/debt_consolidation
www.debt-consolidation-debt-reduction-debt-help.com
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.careonecredit.com
www.secureloanconsolidation.com
www.debtconsolidationunion.com
www.debt-settlement-america.com
www.debtsettlementusa.com
www.debt-consolidation.net
www.forbes.com
www.debt-consolidation-overnight.com
www.usadebt.org
www.libertydebtconsolidation.com
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtreductionservices.org
www.3debtconsolidation.com
debtquotes.com/
www.debtconsolidation-credit.com
www.usadebtconsolidation.net
www.christiandebtconsolidation.org
www.american-debt-consolidation-loans.com
www.creditcounseling.net
www.debtconsolidationloan.com
www.debtconsolidationams.com
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debt10.com
www.debtbusterloans.com
www.freedebtconsolidation.com
www.axiomdebtconsolidation.com
debtconsolidation-now.com/
www.debtfreeamerica.com
www.debthelp.com
www.debtconsolidationandmortgages.com
www.debtcounselingcorp.org
www.debt-consolidation-tips-and-tricks.com
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtconsolidationagencies.com
www.debtconsolidationloanscentral.com
debtconsolidation.com/home.aspx?ses&kbid&kw?1011
helpdebtrelief.com/
www.adviceonline.co.uk
www.kimberlycredit.com
indianadebtconsolidation.com
www.creditsolutions.com
www.cleardebtsolution.com
www.debt-consolidation-diva.com
advertising.microsoft.com/search/
go.microsoft.com/fwlink/?linkid74170
advertising.microsoft.com/search/
www.debtconsolidationcare.com
en.wikipedia.org/wiki/debt_consolidation
www.bankrate.com
www.debt-settlement-america.com
moneycentral.msn.com/content/savinganddebt/managedebt/p36230.asp
www.daveramsey.com
www.adelphia.net
www.forumup.us
www.ftc.gov
www.usbank.com
www.bankrate.com
www.mortgage-calc.com
www.mortgage-calc.com
businessmajors.about.com/od/studentfinances/a/debtconsloans.htm
www.lendingtree.com
www.consumercredit.com
groups.google.com/group/debtsolutions/web/debt-relief-how-to
www.debtconsolidationcare.com
https://www.credit.com
www.debtconsolidationunion.com
financial.wellsfargo.com/
www.daveramsey.com
www.mortgage101.com

Now replace "www." with nothing
Then replace "/.*" with nothing.

Do you also need to remove domain aliases at the front?
Hope this was helpful.............good luck,
Bob
kingliness
Posts: 3
Joined: Fri Mar 21, 2008 4:45 pm

Post by kingliness »

Thanks Everyone

Bob I meant TextPad -

It worked pretty good.

Now how do I get rid of the ?= stuff?

Thanks!
Post Reply