...

View Full Version : Delete Duplicates Lines



josefkrzysztof
05-26-2005, 03:33 PM
Hi,

Hi,

Well I believe this question is for answered for few JS programmers!

I want delete all lines from a textarea by HOST duplicates. The host name begin at"http" and ends by first '/'.

See the example below:

http://www.yourdictionary.com/
http://alt.venus.co.uk/VL/AppLingBBK/welcome.html
http://www.uni-kassel.de/fb8/misc/lfb/html/text/startlfbframeset.html
http://www.sil.org/
http://sp.ask.com/docs/about/index.html
http://sp.ask.com/docs/ad/default.htm
http://sp.ask.com/docs/about/careers.html
http://sp.ask.com/docs/about/wodehouse.html
http://sp.ask.com/docs/about/policies.html
http://sp.ask.com/docs/jeevesinc/default.htm

In this example case we will DELETE ALL lines containaing:
http://sp.ask.com/

In the following example:

http://www.logisticsonline.com/
http://www.loglink.com/
http://dir.yahoo.com/Recreation/Travel/Transportation/
http://dir.yahoo.com/Recreation/Travel/Logistics/
http://www.logisticsplus.net/
http://us.ard.yahoo.com/.......
http://us.ard.yahoo.com/........
http://us.ard.yahoo.com/.......
http://us.ard.yahoo.com/.......

Must be deleted all lines containing :

http://dir.yahoo.com/
and
http://us.ard.yahoo.com/


Good luck!

Thank you in aadvance


jkrzysztof

jbot
05-26-2005, 03:43 PM
are you gonna make an attempt to code this for yourself, or are you practically requesting we do it for you. this a forum for users to seek help, not a place to demand off-the-shelf scripts. what your asking for is relatively complicated, so it's kinda unfair to be asking someone to code this for you unless you're willing to pay - my rate is 50 per hour.

anyway, to kickstart your script, you need to split up the textarea's value into lines. to do this, look for the new line character and split the string on that. this will generate an array. then loop round that array, comparing each line with the next, and if each line starts the same, then delete that line (key) from the array. do this till all keys have been iterated over.

Harry Armadillo
05-26-2005, 11:20 PM
50 per hour? Must be all those verbs you use. :D

To get this post on-topic...once you've split it into separate lines, I suggest parsing the addresses (at least partially) using one of the many script posted in these forums. This will allow elimination of non-exact duplicates (http://yahoo.com/ versus http://www.yahoo.com/ versus https://yahoo.com/).

Willy Duitt
05-26-2005, 11:33 PM
I'm not sure of the current conversion rates but my rate is $120.00Us @hour... :D

BTW: Jbot... Don't forget that you will first need to sort prior to comparing...
(oh, and there's two t's in Duitt)... :)

.....Willy

Oh, I have also seen this exact question asked elsewhere so if you are going to script this for free, be sure to check that someone else has not already provided the script... ;)

josefkrzysztof
05-26-2005, 11:55 PM
I have already the script!

Jkrzysztof

Willy Duitt
05-27-2005, 12:03 AM
I have already the script!

Jkrzysztof

Then why don't you share the solution for others whom may have the same question....



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum