Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] Re: Perl splitting help

On Sat, Jul 22, 2000 at 05:52:42PM +1000, George Vieira wrote:
> I have a problem as I don't know Perl very well and need to do the
> following:
> 1. Grab a file containing a list of people and phone numbers seperated by a
> | .eg.
> --- playlist.txt---
> George Vieira|0410123123
> Another Person|0414321321
> 2. Split the lines into fields so I can print each field into a cell in a
> table.

for such a simple task, i'd go with awk (see herbert's post).

and just to show that you can use sed to write scripts too:
(give data file as an argument or stdin)

#! /bin/sed -f

# header

# footer

# per line stuff
 # change separator

 # change beginning and end of line
 s,^,   <tr><td>,

 - Gus