CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I Need a Programmer for Freelance Work:
Reply to: Multi line file pipe delimiter parsing
 
Subject:
Guest Username:
E-mail address:
Post Style:      Get Markup Help
Icon:
none









Post:




Replying to: Multi line file pipe delimiter parsing by iammankani
Post: 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)

Here an example of a log file.

Example:

Veena |groceries|$1.75
Tim|entertainment$5.00
Jane|groceries|$5.50
Vinh|fuel|$4.75
Jane|entertainment|$8.70
Vinh|fuel|$60.90
Tim|entertainment|$12.80
Veena|fuel|$55
Tim|groceries|$15

Sample output for first question should look something like this:

Total amount spent by each Customer:

Veena:$56.75
Vinh: $ 65.65
Jane: $ 14.20
Tim: $ 32.8


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives