I have to work on processing a large CSV file (~1GB) looks as below using java.
Trans1, 1, 2, 3, 4
Trans1, 2, 3, 4, 5
Trans1, 4, 5, 2, 1
Trans2, 1, 2, 3, 4
Trans2, 2, 3, 4, 5
Trans2, 4, 5, 2, 1
Trans2, 1, 2, 3, 4
Trans3, 2, 3, 4, 5
Trans3, 4, 5, 2, 1
The first 3 lines belong to one transaction, next 4 one transaction. I have to read a batch of transactions may be 1000 at a time. When I read the file it should end at the last line of that transaction.
what is the best way in doing this using java consider the best performance?
Dont want to load the entire file into memory to avoid any performance issues.