Are you trying to with text, or edit text inside an existing one? Are you doing this via Windows GUI or Command Line ? Is this part of a larger automation script ? Let me know so I can provide the exact command or steps! RAR console version User's Manual - GitHub Gist
Use rar a archiveName.rar file1.txt to add a file to a new archive.
Right-click the file(s) you want to add, select "Add to archive..." , then ensure "RAR" is selected under archive format.