I want to make a code to read specific lines and letters from a text file. for example, if savefile.txt said this:
AandV
7
3827
i want it to do something like this:
-set %checkpoint% to [all of row 1 of savefile.txt]
-set %PWR% to [all of row 2 of savefile.txt]
-set %avr% to [1st letter of row 3 of savefile.txt]
-set %zvr% to [2nd letter of row 3 of savefile.txt]
-set %pvr% to [3rd letter of row 3 of savefile.txt]
-set %a2vr% to [4th letter of row 3 of savefile.txt]
is there anyway to do this?
EXTRA: i would also like to know how to write into a specific line of a text file, like so:
if exist DARKENEDcp.txt (
del DARKENEDcp.txt
)
@echo %checkpoint%> [line 1 of DARKENEDcp.txt]
@echo %PWR%> [line 2 of DARKENEDcp.txt]
@echo %avr%%zvr%%pvr%%a2vr%> [line 3 of DARKENEDcp.txt]
if this is possible, that would be very useful for my game.