Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How to read line per line in the text file with the second word only?

$
0
0
I have a text file name Mail order.

The order in the text file is:
101,3,49.99
103,5,2.75
101,8,49.99

the first column (101,103) is the item number, the second column is the quantity per item, and the third one is the price of each item number.

the instruction is to get the total sum of the quantity. in the given example the total sum is 16.
another instruction is to get the total of the price so first i have to add the 3 different prices and divide it to 3.

so the big question i had is how to read the text file line by line by the second word and third word only...

any help would be appreciated.. :)

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>