简体   繁体   English

在记事本++的每行开头删除数字和括号

[英]Remove numbers and parentheses at the beginning of each line in Notepad++

Basically every line in my text file is formatted like this: 基本上,我的文本文件中的每一行都是这样格式化的:

1) Baker
2) Photographer
3) Doctor
4) Teacher
5) CEO

etc, etc. 等等等

Using Notepad++ how do I remove the 1), 2), 3), etc? 使用记事本++如何删除1),2),3)等?

1 ) Press Ctrl + H for pop window to Replace. 1)按Ctrl + H弹出窗口进行替换。
2 ) Provide the ^\\d+\\) regular expression in Find what text field, choose option Regular expression in search mode and make empty in Replace with text field. 2)在“ 查找内容”文本字段中提供^\\d+\\)正则表达式,在搜索模式下选择“正则表达式”选项,然后在“ 替换为文本”字段中将其设置为空。
3 ) Click on Replace all or Replace button. 3)单击全部替换或替换按钮。

在此处输入图片说明

You can use the regex ^\\d+\\) (note the trailing whitespace) and replace text matching this pattern with an empty string. 您可以使用正则表达式^\\d+\\) (请注意末尾的空格),并使用空字符串替换与此模式匹配的文本。

Step-by-step guide: 分步指南:

  1. Press Ctrl + h to open the Replace dialog. Ctrl + h打开“替换”对话框。
  2. Press Alt + F to focus on the Find text field. Alt + F专注于“查找”文本字段。
  3. Enter ^\\d+\\) and press Alt + l to switch to the Replace with text field. 输入^\\d+\\) ,然后按Alt + l切换到“替换为”文本字段。
  4. Press backspace to delete any text that might be in this box. 按退格键删除此框中可能包含的所有文本。
  5. Press Alt + g to switch the search mode to regular expression. Alt + g将搜索模式切换为正则表达式。
  6. Press Alt + a to perform a replace all operation on the document. Alt + a对文档执行全部替换操作。

您可以使用通常通过alt +鼠标访问的列选择模式,或通过编辑菜单选择2列,然后将其删除为任何文本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM