[WEB4LIB:14750] Converting text to HTML

morganj at iupui.edu morganj at iupui.edu
Fri Aug 7 13:29:33 EDT 1998


You'll probably get a lot of other replies, but this is how I would try
to do it.

If the sample below is accurate, I think you could create the file pretty
quick in UNIX using the grep, sed and paste commands.  Use grep to pull
out all the lines beginning with "http://" and put them in a new file.
Use a second grep -w to take out the second http lines that have the odd
characters in them.

Make a second copy of the new file.  Use sed to add "<a href="" preceding
http, and ""> preceding the carriage return in the first file, and </a>
preceding the carriage return in the second file.  Then use the paste
command to stick the two files together.  

These commands could be strung together in 7-line batch file to be run as
needed.

Once you have the file with html links, an automatic link-checking program
like the one at http://www.netmechanic.com/ could be used to check the
links.


Jim Morgan
morganj at iupui.edu



On Fri, 7 Aug 1998, Walter W. Giesbrecht wrote:

> Our library has been adding URLs to the catalogue records of
> electronic journals for some time now. The staff in Bibliographic
> Services need a relatively simple way to check the links in these
> records on a periodic basis. The catalogue software (Sirsi's
> UNICORN) allows them to generate a report (in ASCII) of the
> catalogue records that include URLs (a single record in this
> report looks something like this):
> 
> 	via web browser by entering the following URL:
> 	http://www.idealibrary.com/cgi-bin/links/toc/ab
> 	ISSN: 0  : |a0003-2697
> 	Subject:  0 : |aBiochemistry|xPeriodicals.|?UNAUTHORIZED
> 	Electronic access: 7  : 
> 	|uhttp://www.idealibrary.com/cgi-bin/links/toc/ab|2
> 	http|zhttp://www.idealibrary.com/cgi-bin/links/toc/ab
> 	  YORK--
>         Location: YORKSTEACIE --
>       	Textual holdings: v.10, 1965 -
> 
> What we need to know is: how can we convert this ASCII file into
> HTML and make all the embedded URLs active links? Once we get
> this, we can use link-checking software to test them all. Word 97
> will make a URL into a link by putting a hard return after the
> URL, but doing this is impractical when the most recent report
> was just over 800K in size! Any ideas?
> 
> -- 
> 
> Walter W. Giesbrecht                             walterg at yorku.ca
> York University Libraries                (416)736-2100 ext. 77551
> Toronto, Ontario, CANADA                                  113 SSB
> 



More information about the Web4lib mailing list