View Single Post
Join Date: Sep 2006
Posts: 27
Reputation: donaldunca is an unknown quantity at this point 
Solved Threads: 0
donaldunca's Avatar
donaldunca donaldunca is offline Offline
Light Poster

Re: read each line of file

 
0
  #5
Feb 6th, 2007
If I caculate sum of numbers line by line.
This file "data.inp" have numbers:
6 3 5 4 5
2 5 3 1
5 8 7 9
2 5 6 3 5 8 4 6
I want the result is:
23
11
29
39
(Note: 29= 6 +3 +5 +4 +5
11= 2 +5+ 3+ 1
29= 5 +8 +7 +9
39= 2 +5 +6 +3 +5 +8+ 4+ 6)
thanks!
Reply With Quote