问题
So I have an excel table that I am converting to a tab delimited txt file. The only problem is that at the end of the converted file, there is a blank line. How can i get this to go away automatically?
回答1:
To remove the last empty lines you may use \R+\z
regex and replace with nothing.
To remove the last blank line you may use \R\h*\z
regex and replace with nothing.
Note that in general you may use
Edit -> Line Operations -> Remove Empty Lines
to remove all empty lines anywhere inside the file.
NOTES on regex:
\R
- matches a linebreak (CRLF, or CR, or LF)\R+
- one or more linebreaks\h*
- zero or more (*
) horizontal whitespaces\z
- the very end of the file
来源:https://stackoverflow.com/questions/38721957/remove-blank-line-at-the-end-of-a-text-file-converted-from-an-excel-file