Hello
I have 2 files
1st file is
1 = beer
2 = redbull
3 = vodka
second file is
[50 + 50] bottles of "1" on the wall, [50 + 50] bottles of "1".
Take one down and pass it around, [50 + 49] bottles of "1" on the wall.
[50 + 49] bottles of "2" on the wall, [50 + 49] bottles of "2".
Take one down and pass it around, [50 + 48] bottles of "2" on the wall.
[50 + 48] bottles of "1" on the wall, [50 + 48] bottles of "1".
.....
....
I want to read the numbers from the second file for example [50 + 50] and add those numbers and write to the SAME file at that place 100. I also want to change the "1" to beer.
Can somebody direct me in the right direction. I have studied reading and writing and the different possibilities you have to do this but, I dont see how you can read and write to the same file at the same place. Also what is the best way to get the numbers out?
Thank you in advance.