Hi there,
Anyone out there know the solution to this problem?
[in my .txt file]
[Expense/income]:[amt]:[date]
Mobile Bills:-100:20Jul11
Lunch:-10:23Jul11
Entertainment:-200:25Jul11
Salary:3000:25Jul11
I would like to extract all the values of money spend(amt) and do some manipulation. e.g adding, subtracting.
Any kind soul know how to do this?
Last edited on
getline each line into a string,
.find(':') and .substr to split each line into 3 strings.
use a stringstream to convert the middle to an integer.
Hi hamsterman,
thanks for the help. I have somehow managed to get the desired string based on your suggestion.