- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] Perl splitting help
- From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
- Date: Sat Jul 22 20:03:21 2000
- Organization: Core
George Vieira <georgev@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> 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.
Try this AWK script:
#!/usr/bin/awk -f
BEGIN {
FS = "|"
}
{
print " <tr>"
print " <td>" $1 "</td>"
print " <td>" $2 "</td>"
print " </tr>"
}
--
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt