Then click Ctrl+H to bring up the replacement function window.
Then enter "space" in the search content (note that you don't enter the word space, but click the space button).
Do not enter anything in the Replace field, and then select Replace All. In this way, all the contents with spaces in TXT will be deleted, and then the text will be typeset as required.