From owner-freebsd-questions@FreeBSD.ORG Tue Mar 25 18:09:44 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F94937B404 for ; Tue, 25 Mar 2003 18:09:44 -0800 (PST) Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id D6F3E43F93 for ; Tue, 25 Mar 2003 18:09:42 -0800 (PST) (envelope-from barner@in.tum.de) Received: from mailrelay1.informatik.tu-muenchen.de (mailrelay1.informatik.tu-muenchen.de [131.159.254.5]) by mailout.informatik.tu-muenchen.de (Postfix) with ESMTP id 9781F618C; Wed, 26 Mar 2003 03:09:41 +0100 (MET) Received: from mail.informatik.tu-muenchen.de (mail.informatik.tu-muenchen.de [131.159.0.26]) by mailrelay1.informatik.tu-muenchen.de (Postfix) with ESMTP id 8A1A07946; Wed, 26 Mar 2003 03:09:41 +0100 (MET) Received: from zi025.glhnet.mhn.de (unknown [129.187.19.157]) by mail.informatik.tu-muenchen.de (Postfix) with ESMTP id 65F156CC24; Wed, 26 Mar 2003 03:09:41 +0100 (MET) Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000) id D952A36D11; Wed, 26 Mar 2003 03:09:39 +0100 (CET) Date: Wed, 26 Mar 2003 03:09:39 +0100 From: Simon Barner To: Dru Message-ID: <20030326020939.GA657@zi025.glhnet.mhn.de> References: <20030325204410.D17599@dhcp-17-14.kico2.on.cogeco.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20030325204410.D17599@dhcp-17-14.kico2.on.cogeco.ca> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-31.0 required=5.0 tests=HTML_00_10,HTML_MESSAGE,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: questions@freebsd.org Subject: Re: port to convert comma delimited file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD user questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2003 02:09:45 -0000 X-List-Received-Date: Wed, 26 Mar 2003 02:09:45 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, > I have a comma delimited file with approximately 7000 rows and 5 columns. > I have absolutely no database skills and and almost as much HTML skill, > yet I need to convert this file into an HTML table. Is there something in > the ports collection that will do this for me, a sort of converter for > dummies? Barring that, is there any port that will do this, hopefully with > docs so I can learn as I go? You will not need the ports collection. All you need is the perl programming language, and that's in the base system (at least, if you are running 4.x, for 5.x you will have to install a port indeed). Have a look at the 'split' function. Your perl script will perform the following algorithm: print (""); Read the input file line-wise for each line, do the following print (""); split the line (with comma as separator) and put the result into an a= rray =20 for each component of the array (see the 'shift' function) print (""); =20 print (""); =20 print ("
"); now print the element print ("
"); There are lots of perl tutorials around the 'net, but if you perfer books, = I'd recommend "Lerning Perl" (Oreily), which I found very helpful. Btw.: Some perl knowledge can never harm in a UN*X environment. Your task i= s an ideal motivation to get to now this mighty language. Simon --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+gQvjCkn+/eutqCoRAiXyAJ4/mfN+yRixdN6KRtp/DCBajQyt7ACgkP8g U2h68YPaNQtfxOTImXV/l/s= =0Fig -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--