From owner-freebsd-questions@FreeBSD.ORG Tue Mar 25 19:04:30 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 50D5337B401 for ; Tue, 25 Mar 2003 19:04:30 -0800 (PST) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC06543F75 for ; Tue, 25 Mar 2003 19:04:28 -0800 (PST) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-a041.otenet.gr [212.205.215.41]) by mailsrv.otenet.gr (8.12.8/8.12.8) with ESMTP id h2Q34Mh1022575; Wed, 26 Mar 2003 05:04:23 +0200 (EET) Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.12.8/8.12.8) with ESMTP id h2Q34LOD016100; Wed, 26 Mar 2003 05:04:21 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.12.8/8.12.8/Submit) id h2Q34KtC016099; Wed, 26 Mar 2003 05:04:20 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 26 Mar 2003 05:04:20 +0200 From: Giorgos Keramidas To: Dru Message-ID: <20030326030420.GA16019@gothmog.gr> References: <20030325204410.D17599@dhcp-17-14.kico2.on.cogeco.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030325204410.D17599@dhcp-17-14.kico2.on.cogeco.ca> X-RAVMilter-Version: 8.4.2(snapshot 20021217) (terpsi) X-Spam-Status: No, hits=-24.8 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,HTML_00_10,HTML_MESSAGE,IN_REP_TO, QUOTED_EMAIL_TEXT,RCVD_IN_UNCONFIRMED_DSBL,REFERENCES, REPLY_WITH_QUOTES 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 03:04:31 -0000 X-List-Received-Date: Wed, 26 Mar 2003 03:04:31 -0000 On 2003-03-25 20:51, Dru wrote: > 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? Someone mentioned Perl. Try the following little Perl snippet: #!/usr/bin/perl print "\n"; while (defined($line = )) { chomp $line; print "\n"; } print "
" . join("", split(/;/, $line)) . "
\n"; Save this to a file called csv2html.pl and then run it like this: $ perl csv2html.pl < filename.csv > filename.html The power of Unix as an environment comes from the ability to write small, throw-away programs like this one, in one of the dozens of scripting languages that are usually available. Why hunt for a port to do something so simple[1] ? [1] For some definintion of `simple'.