in reply to Working on a file.
scriptinperl - this isn't a code writing service! If you want help, you'll need to at least give us some code that you have tried and some example data...