删除notepad ++中文件数量中特定部分的空行

时间:2017-07-14 12:59:26

标签: notepad++

在notepad ++中,我需要一个插件来仅删除特定部分的private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { Excel.Application xlApplication = (Excel.Application) System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application"); Excel.Workbook xlWorkbook = (Excel.Workbook) xlApplication.ActiveWorkbook; Excel.Worksheet xlWorksheet = (Excel.Worksheet) xlWorkbook.ActiveSheet; Excel.Range xlRange = xlWorksheet.UsedRange; ((Excel.Range) xlWorksheet.Rows[dataGridView.CurrentCell.RowIndex + 2]).Delete(Type.Missing); dataGridView.Rows.RemoveAt(dataGridView.CurrentCell.RowIndex); } catch { MessageBox.Show("Could not update the Excel file. Make sure the file is open.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } 。我们有一个empty lines插件。但该插件运行良好。但我需要删除空行只选择特定区域的文件数量。

任何人都可以建议我使用一个插件。

1 个答案:

答案 0 :(得分:0)

我不知道插件,但你可以搜索/替换这样的空行:

正则表达式查找/替换如下:

  • 选择特定区域
  • 打开替换对话框
  • 查找内容: ^$\R
  • 替换为:(无)
  • 检查正则表达式
  • 选中选择
  • 点击全部替换

<强>解释 * ^$\R是一个正则表达式,匹配包含换行符charactar

的空行