#!/usr/bin/perl
# program to convert a large NETSCAPE bookmark.htm file to a directory of smaller files
# copyright, Chris Evans 30.i.96
# program takes a Netscape bookmarks file,
# strips
tags and blank lines from it
# saves it under a new name
# opens and runs through this creating a file of HREF pointers
# to other files it creates (usually in another directory)
# each of which has a name reflecting the header in the bookmark file
# has the title of the header in the HREF pointer to that file
# and contains all the HREFs actually stored in the Netscape
# bookmarks file under that header.
# the file of pointers has a nested list structure reflecting
# the nested headers structure in the bookmark file
# because of the clumsy way in which I've done this
# the pointers file is opened after saving and the redundant
#
pairs between headers on the same level which have
# no subsidiary headers are stripped out before saving the file
# again. I'm sure there's a better way around this!
# file names and directories are all set here
$verbose = 1; #to get feedback on what it's doing!
$dir1 = "./"; # location of the Netscape bookmark file
$bookmark = "bookmark.htm"; # name of that file
$bookmk = "bookmk.htm"; # name of file after stripping
and space
$dir2 = "./bkmks/"; # directory for the files created for each
# header in the bookmark file as seen by OS
$dir3 = "/mhs/psychotherapy/bkmks/"; # as seen via the WWW server
$ptrs1 = "ptrs1.htm"; # file of pointers to new files in $dir2
# before stripping pairs
$ptrs = "ptrs.htm"; # and after stripping
# I put this next bit at the bottom of all files in dir2
# you will want to change it to reflect your setup
$btm = <
File created using Perl script:
ptrs.prl written by Chris Evans
C.Evans\@sghms.ac.uk