Hello all,
This one is probably very easy for most of you and it would help me a 
great deal if someone could tell me how to do it. I know there's a 
bunch of tutorials, perldocs and manuals out there, but I'm getting 
confused.

I receive files with the following line format:
<tr>
<td> &nbsp;ENKA10577207
</td>
<td> &nbsp;p1234567
</td>
<td> &nbsp;Enkerli-Smith Tremblay, Alexandra Jean-Sébastien
</td>
<td> &nbsp; alexandre.jean-Sé[EMAIL PROTECTED]
</td>
</tr>

These are:
Permanent code
Access code
Names, First names
Email address (usually of the [EMAIL PROTECTED], but not always)

The "Permanent code" is made up of:
Last name's first three letters plus first name initial
day (01-31)
month+sex (month (01-12) for males, month+50 for females)
two-digit year (00-99)
extra digits (I don't know what they mean)

What I'd like to get is a tab-delimited file with the following
Permanent code
Access code
Names
First names
Sex
Age (or, at least, formatted birthdate)
Email

And then do calculations by age and sex.
Now, I've been doing this semi-manually, but I'm sure this is trivial 
to do in Perl and it looks like an ideal learning opportunity. What 
I've tried so far (with F[n]s, unpack, regexp...) doesn't really work. 
A complete script (likely a one-liner) would be wonderful.

Thanks in advance for your help.

Alexandre Enkerli
Ph.D. Candidate
Department of Folklore and Ethnomusicology
Indiana University

Reply via email to