Remove bah from url ?

Replace "blah" using notpad or notpad++ with empty.
You can also filter it with scrapebox.
 
I'd use Notepad and replace the '/bah' with nothing if I were you.
 
I'd use Notepad and replace the '/bah' with nothing if I were you.
since the /blah blah blah part won't be the same for every line, the search and replace in notepad won't help him. Unless he wants to just go through manually removing it line by line. I think he'd rather it be automated. :rolleyes:

The PHP solution fatboy suggested is a better way. He can use the function to parse through the lines to find something like the third slash and remove everything after that till the next line and keep repeating the task for each line until the eof. The script can parse through the first file and write a new file with the data cleaned up in the way the OP wants it.


:call2:
 
Last edited:
Try CSVed

Open it as a CSV-file, set the delimiter to " " (space) and delete column 2 and you're all set.
 
since the /blah blah blah part won't be the same for every line, the search and replace in notepad won't help him. Unless he wants to jsut go through manually removing it line by line. I think he'd rather it be automated. :rolleyes:

Ha..missed the blah blah part. I just saw the title (mentioning /bah) and the link that ends with /blog. I figured /bah = /blog. Didn't notice there's more after the /blog. Yeah using notepad in that case would be stupid. :o:o:o
 
Thanks guys for the help, yer il give the php way a shot
 
This should work:

Code:
<?php

        $urls = file('urls.txt');
        foreach($urls as $url)
        {
                print "http://" . parse_url($url, PHP_URL_HOST) . "\n";
        }
?>

Just put all your urls in urls.txt, one per line then run the script.


** EDIT **
If you want the URLs in another file then do:
Code:
php scriptname.php > output.txt
 
Last edited:
Back
Top