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: Perl Programming Help: Intermediate:
How can this be done?

 



zaro
Deleted

Jan 24, 2001, 4:05 PM

Post #1 of 1 (354 views)
How can this be done? Can't Post

Say I got the following data file;

data.txt
-----------------------------------------
1001|21/01/01|E|0.10
1002|21/01/01|E|0.10
1003|21/01/01|E|0.10
1004|24/01/01|S|0.05
1005|24/01/01|S|0.05
-----------------------------------------

For each "day" (ie. 24) and type (ie. E or S), sum the value $data[3] so that the print would be;

21/01/01 E 0.30
24/01/01 S 0.10

Also, how to keep the sum with two decimals (.ie. 0.00)?

Regards,

Zaro


 
 


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

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