Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 May 96 07:19:00 PDT
From:      "Gregory, Scott D. SRA SAF/AADO" <sgregory@PUBSPO.hq.af.mil>
To:        questions <questions@freebsd.org>
Subject:   Help With Scripts
Message-ID:  <31A323B6@pubspo.hq.af.mil>

next in thread | raw e-mail | index | archive | help

Hi,

I'm trying to write a script to create HTML pages from a text file (output 
from a database).  I'm new to FreeBSD (2.1) and UNIX and I can't find the 
appropriate books at the library.

My text file is delimited by '@' and has 7 fields (see below).  I would like 
to convert this into a HTML table.  An example of how I would like my output 
is below.  The example shows what fields I would like and where they should 
be placed.  I would like to separate the pages by the 100 (00-99 (saved to 
filename af0000-0099.html, af0100-0199.html, etc.) (field 1--AF000, AF001, 
AF002, etc.), however, the directory location of the file is by the 1000 
(which is why I need to extract characters 1,2 and 4 from the 1st field.

I'm not currently subscribed to questions, so please email me directly at 
sgregory@pubspo.hq.af.mil or sgregory@ameritel.net.  Thanks in advance for 
your assistance.

C-ya

Scott


SAMPLE TEXT FILE:

AF00003@OC86@af0003.frl@Hazard@1@9130@AF1-301
AF00008@MA85@af0008.frl@Certificate@3@1100@A1-401
AF00049@AP95@af0049.frl@Application@1@3620@A36-2619
AF00053@FB88@af0053.frl@Blotter@1@3120@AF1-201
AF00078@JA91@af0078.frl@Recommendation@1@3600@A36-9
AF00081@MA81@af0081.frl@Description@1@3810@A38-201
AF00108@JA91@af0108.frl@Processing@2@4000@A40502
AF00115A@AU52@af0115a.frl@Numbers@1@2300@AM6-1
AF00116@SE80@af0116.frl@Criteria@1@3110@A31-101V1
AF00126@OC69@af0126.frl@Log@1@1020@A10-215
AF00130@DE95@af0130.frl@Symbol@1@3740@AI7-124
AF00143@SE82@af0143.frl@Page@1@3120@AF1-401
AF00191@JL95@af0191.frl@Request@1@2320@AFM-1V1
AF00230@NO82@af0230.frl@Transfer@1@4120@AF1-210
AF00233@FB96@af0233.frl@Contract@1@3620@AF6-2107
AF00235D@NO86@af0235d.frl@Supplement@2@4000@AFM8-695V1
AF00242@JN90@af0242.frl@Staff@1@5100@AFR11-1
AF00259@AU95@af0259.frl@Worksheet@1@3620@AF36--3212
AF00304@JN95@af0304.frl@Counsel@1@5110@AF51-201
AF00310@NO95@af0310.frl@Document@1@3120@AF31-401
AF00321@AU71@af0321.frl@Record@2@3150@AF1-202
AF00332@JA91@af0332p1.frl@Work Request@1@3600@AFR30-20
AF00340@MA95@af0340.frl@Data@1@3110@AF31-101V1

SAMPLE OUTPUT:

<html>
<head>
<title>Electronic Foo</title>
</head>
<body>
<center>
<h1>Electronic Foo</h1>
<table>
<tr>
<td>Short Title</td>
<td>Date</td>
<td>Title and Version</td>
<td> Code</td>
<td>Publication</td>
</tr>
<tr>
</tr>
<tr>
<td><a href="../../forms/'field 1 characters 1,2, and 4'/'field 3'">'field 
1'</a></td>
<td>'field 2'</td>
<td>'field 4', Ver 'field 5'</td>
<td>'field 6'</td>
<td>'field 7'</td>
</tr>
...............etc., etc.

</table>
</body>
</html>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31A323B6>