i have a file like a1 0.7 a2 0.5 b1 0.6 b2 0.8
a2 0.4 b3 0.6
a1 0.3 a2 0.4 a3 0.7
i want to read a file data and add values if it has same variables.Ex; a1=1.0 a2=1.3 a3=0.7 b1=0.6 b2=0.8 b3=0.6
whats the concept used to done this.i need urgently its very useful to my project .

Recommended Answers

All 2 Replies

And a Map could prove useful in aggregating the values after you have parsed them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.