如何使用UltraEdit去删除空白行?

    技术2024-10-11  58

    在DOS/Unix/Mac字符格式下,使用兼容Perl语言的正则表达式来删除空白行

    可以在工具栏里依次点击“高级”=》“配置”=》“正则表达式”或者在“查找/替换”对话框里直接勾选“正则表达式”来使用正则功能。

    查找:"^/r?/n?$ " (不含引号,斜体部分。)

    替换:“”

     

    希望能给大家节约时间。

     

    +++++++++++++++  华丽的分割线  ++++++++++++++++++++++++++++++++++++

    To delete blank lines in DOS/Unix/Mac formatted-files, use the following Perl-compatible regular expression. You can enable Perl-compatible regular expressions under Advanced -> Configuration -> Search -> Regular Expression Engine or directly in the replace dialog after clicking on the Advanced button in the lower pane of the dialog.

    Replace: "^/r?/n?$" (without the quotes) With "" (without the quotes - i.e. nothing).

    Earlier versions of UltraEdit:

    To delete blank lines with DOS line terminators you can use an UltraEdit-style regular expression replace as follows:

    Replace: "^p$" (without the quotes) With "" (without the quotes - i.e. nothing).

    Run this replace until every blank line is deleted.

     

    原文链接地址:http://www.ultraedit.com/support/faq.html

    最新回复(0)