Searching for a Tool

jabbidoo

Junior Member
Joined
Oct 21, 2008
Messages
173
Reaction score
152
Hi,
I've a .txt-file in which many urls are. Now, I just want to have the domains of them. For example:
In the txt-file:
Code:
http://www.abc.de/abc/cba.html
I want to have:
Code:
http://www.abc.de/

Is there a tool?

Jan
 
well .. if you know a bit of php you could always do this

Code:
<?php

$lines = yourtextfile.txt;
foreach($lines as $line)
{ 
$new_url=parse_url($line,PHP_URL_HOST);
}
array_unique($new_url);

echo $new_url;
?>

I hope this helps, i'm not very skilled at php so please don't flame :)
 
Last edited:
Hmmm...don't work:( but thanks for your help!

Code:
Warning: Invalid argument supplied for foreach() in /home/.../urls.php on line 4

Warning: array_unique() [function.array-unique]: The argument should be an array in /home/.../urls.php on line 8
 
You could do this using excel, just open the text file from excel using / as the delimiter.
 
You could do this using excel, just open the text file from excel using / as the delimiter.

Thanks a bunch for this idea!! Works like a charm!!
 
Back
Top