Reputation: 159
With command line in Windows, I have a game score system which goes on. It saves the scores into a text file by using the code:
if %LS_RegioLex_EndSave%==1 (echo Single Player Latest Score 1 - RegioLex: %S_REGIOLEX_SCORE% > LostChamberSinglePlayerRegioLexSCORE01.txt)
How do I do the opposite and get the saved scores from the text file and display them?
Upvotes: 0
Views: 128
Reputation: 945
Assuming you load the .txt to a string, you can split a string as shown in this thread, or as shown here
Any reason you're tied to batch? Powershell makes it a cakewalk with Import-CSV
Upvotes: 1
Reputation: 41224
This gives you the data on the first line.
set /p "var="<"LostChamberSinglePlayerRegioLexSCORE01.txt"
echo "%var%"
Upvotes: 0