[Sderby] PERL
Mike Hemstock
hemstock at tiscali.co.uk
Thu Nov 13 14:57:22 GMT 2003
Folks,
A quick question. I am trying to write a PERL script to open a file, read
values from it and rebuild those vaules into another file to be used by a
piece of software. An extract from the file is below:
a.adams.DADIESO SEC. SCH. - DADIESO.
a.adigah.ACHISCO.
a.agyapong-ntra.OPON MEM SEC. SCH..
a.amoah.EFUTU SEC. TECH.
The first part of the line is an initial, the second is a surname and the
third is a school. I can read the data into a variable line by line, but
want I can't figure out how to do it take that line and extract the three
pieces of information and assign them to a variable eg. after reading the
first line into $_ I would then like:
$initial = "a"
$surname = "adams"
$school = "DADIESO SEC. SCH. - DADIESO"
I'd also like to drop the . off the end of each line. Some lines have two
dots but that's OK, just need to drop one of them.
Many thanks,
Mike who can't code very well!
More information about the Sderby
mailing list