As requested, I'm posting the code. I'm not experienced, so some things may be a bit unnecessary. And, to clear things up, I'm creating a bot for discord. I'm using the JDA (Java Discord API) and a couple of their objects and methods. "channel" discovers in what channel this user sent the message, "sendMessage()" is, to the point, sends a message to that discord server using the bot, "message" contains the raw content of the message sent by any user, and "queue()" sets the messages sent to the bot in an order by which came first. Hope that helps.
To summarize, first, I create a new text document, add the tag "(copy)" to it, and reference the original. During this process, I check if the current line starts with "Wallet:", and if it does, I add the user's amount to the amount listed in the original text document, and then I print the result in that current line of the duplicate.
Then, I re-write over the original by referencing the duplicate. After this, I attempt to delete the duplicate.
Hopefully that clears it up.