Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以让type命令跳过文本文件中的空行?
type
或者是否有替代命令可以打印出文本文件的内容,同时跳过该文本文件中的空行?
sed for Windows 的解决方案
sed "/^$/d" file_with_empty_lines > file_without_empty_lines
或没有外部工具:
(for /f "usebackqdelims=" %%a in ("file_with_empty_lines") do echo(%%a)> file_without_empty_lines