I have a text file as in /1/. The first column is product Volumn, and second column is product weight. My pupose it to calcuate total_Volumn/total_Weight. Earlier Java version has to read all lines, then parse, and for loop ...., anyway many lines. But this is calcuated by single thread. I would like to Java 8 feature, such us map, reduce, to make this calculation with few lines. Besides, the calculations is more efficient sine Java8 uses multi-threads Any example?
/1/ textData.txt
Volumn Weight
1010.0 3458
34334 322
3434 343
3433 542
3134 146
3393 246
...
9787 3023