manipulate a list of urls

  • Thread starter Thread starter orco
  • Start date Start date
If this is for coding a web page use an alternate script. Is it a
dropdown you are coding?
POKO
--
P. Keenan - Webmaster
Web Page Design
Manitoulin Island, Canada
http://manitoulinislandwebdesign.it-mate.co.uk/
(e-mail address removed)
 


if this is only an occasional thing, and you happen to have a text editor
that can record a sequence of actions:

1. open file in editor and go to bottom of file
2. make the editor start recording
3. search backwards for a forward slash
4. delete to end of line
5. go to previous line
6. go to end of line
7. stop recording
8. play recorded sequence as needed



jack
Already at last record of scrolled region
 
if this is only an occasional thing, and you happen to have a text editor
that can record a sequence of actions:

1. open file in editor and go to bottom of file
2. make the editor start recording
3. search backwards for a forward slash
4. delete to end of line
5. go to previous line
6. go to end of line
7. stop recording
8. play recorded sequence as needed

or just use a search and replace tool.

search for "/[^/]+$" replace with "/"
 

Use a text editor with support for search and replace using regular
expressions, there are several of them that are freeware, for example
with SciTE you use:

Search: \(.+\/\).+
Replace: \1

SciTE homepage:
<http://www.scintilla.org/SciTE.html>

or you could try Crimson Editor:
<http://www.crimsoneditor.com/>

or Syn Text Editor:
<http://syn.sourceforge.net/>

Another solution is using GNU Sed in a DosBox/Batch file:

Cat %filename% | sed -e "s/\(.\+\/\).\+/\1/"

GNU Sed is packaged with both UnxTools:
<http://unxutils.sourceforge.net/>

and Cygwin:
<http://www.cygwin.com/>

HTH
 

Got Python ???? http://www.python.org

The following Python program will strip the file names
from a list of urls provided in a single input file
leaving the base url ....

If the program is saved in a file named url_bases.py
and the list of urls is in a file named urls_in.txt
with each url on a separate line, usage of the program is ....

python url_bases.py urls_in.txt

This will display the resulting base urls on the console ....

To save them to a file, re-direct the output ....

python url_bases.py urls_in.txt > urls_out.txt


# url_bases.py

import sys

file_in = file( sys.argv[ 1 ] , 'r' )

def url_base( url_in ) :

this_list = url_in.split( '/' )

this_str = '/'.join( this_list[ 0 : len( this_list ) - 1 ] )

return this_str

for this_url in file_in :

this_base = url_base( this_url )

print this_base

file_in.close()
 
Thank you to all :)

I tried text editor SciTe
searching for "/[^/]+$" and replacing with "/"
and works well


later i tried using GNU Sed in a DosBox/Batch file:

Cat %filename% | sed -e "s/\(.\+\/\).\+/\1/"

and works too





gracias from Barcelona :)
 
orco said:

I think others have already solved your problem. I'd just like to say that
the four sample URLs are worth a visit, especially the last one. Thanks a
lot,

===

Frank Bohan
¶ The principal singer of nineteenth century opera was called pre-Madonna.
 
Frank said:
I think others have already solved your problem. I'd just like to say that
the four sample URLs are worth a visit, especially the last one. Thanks a
lot,
I agree - can we have the whole list? :)
 
I think others have already solved your problem. I'd just like to say that
I agree - can we have the whole list? :)

--


hi again, these are my favorites videos:


http://www.officeclips.com/clips/fall1.mpg
http://teamworscht.gymi-gernsheim.de/upload/files/chant.mpg
http://www.crackman.de/newtenlightment/movies/ballmer/dancemonkeyboy.mpeg
http://users.pandora.be/Psychotic_Kenshin/grappig/Ramzi.wmv
http://www.zangenberg.net/video/apache_helicopter_vs_iraqis.mpeg
http://eratest.free.fr/ogrish/train2.avi
http://site.planethorst.com:8100/sites/funny/new/firemelon.wmv
http://www.helenandbarry.com/WilliamHung.wmv
http://corq.mine.nu/how-to-walk.mpeg
http://imgsrv.fun4fun.com/public_html/Binnes/26022004/videos/bang.wmv
http://www.0wnag3.net/0wned/choque.mpeg
http://users.skynet.be/fa609248/video/kilekon.wmv
http://www.let-it-go.net/laffery/Funny - Suicide cat.mpeg
http://www.people.virginia.edu/~dra8d/cat.wmv
http://fun.drno.de/movies/funny_cats_1.wmv
http://www.dicas-l.unicamp.br/download/prodigy90_med.avi
http://thomasson.nu/video/Camo_plays_Mario.WMV
http://www.swoj.com/downl/matrixcow.wmv
http://kirra.net/loading_a_bike.mpeg
http://imgsrv.fun4fun.com/public_html/Binnes/26022004/videos/reveil.wmv
http://media.skoopy.com/vids/vid_00175.wmv
http://www.ssmf.net/silvesterspass.wmv
http://www.nycpctech.com/files/punchie.wmv
http://plikas.www.lt/video/piranijos.wmv
http://txc.net.au/~mapie/Seat Panda.wmv



and this pages:


http://fun.drno.de/
http://storm.isw.student.khleuven.be/~tom/stuff/funstuff/
http://www.leech.dk/
http://videos.cainer.net/
http://www.stud.ntnu.no/~shane/stasj/pics/humor/div/
http://www.nata2.info/humor/
http://m0rten.mine.nu/morten/fun/
http://fun.tmc.dyn.ee/



with WinHTTrack (www.httrack.com freeware) or Teleport Pro
you can download all stuff



bye :)
 
Back
Top