I have a txt file which contains:
1:2
2:5
3:10
4:1
I need to be able to add to these numbers. For example I want to add to the last line +5:
1:2
2:5
3:10
4:6
How can I achieve this? I was wondering if the right way was to input the file into an array but I have no idea how to do this as I need to separate the numbers into keys and values, I guess?