Multi line file pipe delimiter parsing by iammankani
The code should be written in Perl should be commented appropriately. The solution should be executable, portable and should not have any undefined functions. Use of standard libraries is fine. The solution will be judged on efficiency, portability, readability and completeness.
The BANK keeps track of the customer spending behavior by categorizing the purchases into pre-defined categories like groceries, entertainment and fuel. There are no other categories to consider for this task The log recorded by the software is in the following format: Customer name|category|amount A reference file has been provided below to test out the code.
Write a program/script to parse this information and 1. Generate a report(output file) total amount spent by each customer 2. Generate a report (output file) listing their spending in each category 3. Generate a report (output file) by sorting the list of customers based on highest spenders in each category (groceries, fuel, tobacco-liquor)