Lets say I have a .csv (comma separated value) file looking like this:
Code:
123,1,"Abc",16.7
124,1,"Def",75.1
125,2,"Ghi",12.2
126,2,"Jkl",78.3
127,3,"Mno",12.3
128,4,"Pqr",84.9
129,4,"Stu",92.0
I want to find every line which has the number 4 in field 2, and change them to 7.
That would be these lines:
Code:
128,4,"Pqr",84.9
129,4,"Stu",92.0
Into this:
Code:
128,7,"Pqr",84.9
129,7,"Stu",92.0
I was thinking of searching for the first comma on each line, and checking if the number behind it is 4.
But with my very limited C++ knowledge I don't really know how.
Could anyone show me how to do this with comments to explain me what you did?

If anyone is interested, the reason I need this is for mass editing gamedata files that contains thousands of lines,
instead of opening them up in notepad and editing the lines manually one by one.

Thanks.