This should be no problem, would the data be exported one group at a time to seperate files or sent as groups at one time to one file?
For the first type, one group at a time an SQL query can be run to filter the data for each group.
For the second type a single "Group By" query can be used.

Once you can tell us which way to process the data we can provide some VBA to perform the operation.

ps Is it a CVS or CSV (Comma Seperated Values)?