Not to sound too critical here, but in case you haven't realized it yet, just posting vague descriptions about what you have and want usually means you're only going to get vague answers in return. You need to post detailed information and ask focused questions if you want detailed, useful replies.
It's also a good idea to demonstrate that you're making some effort to work out a solution on your own as well. Most of us prefer to provide guidance and help over rough spots rather than posting flat-out solutions.
Please read How To Ask Questions The Smart Way
, and then tell us exactly
what you want to do, what you've attempted so far, and where you're getting hung up.
At the very least post a sample of the input file, what you need to get out of it and in what format, and whatever non-working script-work you've tried already.
We'll be glad to help out if given the right context.