I have a CSV file with 237 lines of transactions, I’ve already figured out to group, sort, and create a new CSV file with the transactions in the correct order sorted by account number. However I’d like to go one step further and create multiple CSV files based on the account number with all of that account number’s transactions.
I think what I’d like to do just append each line to the appropiate CSV file based on the account number, but I’d like to do this dynamically so I don’t have to create each variable since there is always an unknown number of account numbers.
Account #, Date, Dollar Amount (stored as heading)
001, 1/1/11, $25
001, 1/1/11, $20
002, 1/1/11, $15
003, 1/4/11, $19
So with this data I’d like to create three separate CSV files based on the Account number. I am not looking for someone to write the code, but I am hoping there is some module in Python I’m unaware of that involves this type of process. If someone could please point me in the right direction I’d greatly appreciate it.
Thank you
This is a quick (and probably not so efficient) solution.