本文翻译自:Find CRLF in Notepad++
How can I find/replace all CR/LF characters in Notepad++? 如何在Notepad ++中查找/替换所有CR / LF字符?
I am looking for something equivalent to the ^p special character in Microsoft Word. 我正在寻找与Microsoft Word中的^ p特殊字符相当的东西。
参考:https://stackoom.com/question/Yqj/在Notepad-中查找CRLF
Assuming it has a "regular expressions" search, look for \\r\\n. 假设它有一个“正则表达式”搜索,请查找\\ r \\ n。 I prefer \\r?\\n, because some files don't use carriage returns. 我更喜欢\\ r?\\ n,因为有些文件不使用回车。
EDIT: Thanks for the feedback, whoever voted this down. 编辑:感谢您的反馈,无论是谁投票。 I have learned that... well, nothing, because you provided no feedback. 我已经了解到......好吧,没有,因为你没有提供反馈。 Why is this wrong? 为什么这是错的?
[\\r\\n]+
should work too [\\r\\n]+
应该有效
Update March, 26th 2012, release date of Notepad++ 6.0 : 更新2012年3月26日, Notepad ++ 6.0的发布日期:
OMG, it actually does work now!!! 天哪,它现在确实有效!!!
Original answer 2008 (Notepad++ 4.x) - 2009-2010-2011 (Notepad++ 5.x) 原始答案2008(Notepad ++ 4.x) - 2009-2010-2011(Notepad ++ 5.x)
Actually no, it does not seem to work with regexp... 实际上不,它似乎不适用于正则表达式...
But if you have Notepad++ 5.x, you can use the ' extended ' search mode and look for \\r\\n
. 但是如果你有Notepad ++ 5.x,你可以使用' 扩展 '搜索模式并查找\\r\\n
。 That does find all your CRLF
. 这确实找到了你所有的CRLF
。
(I realize this is the same answer than the others, but again, 'extended mode' is only available with Notepad++ 4.9, 5.x and more) (我意识到这是与其他答案相同的答案,但同样,“扩展模式”仅适用于Notepad ++ 4.9,5.x等)
Since April 2009, you have a wiki article on the Notepad++ site on this topic: 自2009年4月起,您在Notepad ++网站上有关于此主题的Wiki文章:
" How To Replace Line Ends, thus changing the line layout ". “ 如何替换线端,从而改变线路布局 ”。
(mentioned by georgiecasey in his/her answer below ) ( georgiecasey在下面的回答中提到)
Some relevant extracts includes the following search processes: 一些相关摘录包括以下搜索过程:
Simple search ( Ctrl + F ), Search Mode =
Normal
简单搜索( Ctrl + F ),搜索模式=Normal
You can select an
EOL
in the editing window. 您可以在编辑窗口中选择EOL
。
- Just move the cursor to the end of the line, and type Shift + Right Arrow. 只需将光标移动到该行的末尾,然后键入Shift + 向右箭头。
- or, to select
EOL
with the mouse, start just at the line end and drag to the start of the next line; 或者,要使用鼠标选择EOL
,请从行尾开始并拖动到下一行的开头; dragging to the right of theEOL
won't work. 拖动到EOL
的右侧将无法正常工作。 You can manually copy theEOL
and paste it into the field for Unix files (LF
-only). 您可以手动复制EOL
并将其粘贴到Unix文件的字段中(LF
-only)。Simple search (Ctrl+F), Search Mode = Extended 简单搜索(Ctrl + F),搜索模式=扩展
The "Extended" option shows
\\n
and\\r
as characters that could be matched. “扩展”选项将\\n
和\\r
为可以匹配的字符。
As with the Normal search mode, Notepad++ is looking for the exact character. 与普通搜索模式一样,Notepad ++正在寻找确切的字符。
Searching for\\r
in a UNIX-format file will not find anything, but searching for\\n
will. 在UNIX格式文件中搜索\\r
\\n
将找不到任何内容,但搜索\\n
将会找到。 Similarly, a Macintosh-format file will contain\\r
but not\\n
. 同样,Macintosh格式的文件将包含\\r
但不包含\\n
。Simple search (Ctrl+F), Search Mode = Regular expression 简单搜索(Ctrl + F),搜索模式=正则表达式
Regular expressions use the characters
^
and$
to anchor the match string to the beginning or end of the line. 正则表达式使用字符^
和$
将匹配字符串锚定到行的开头或结尾。 For instance, searching forreturn;$
will find occurrences of "return;" 例如,搜索return;$
将发现“return”的出现 that occur with no subsequent text on that same line. 在同一行上没有后续文本的情况下发生。 The anchor characters work identically in all file formats. 锚字符在所有文件格式中的工作方式相同。
The '.' '。' dot metacharacter does not match line endings. 点元字符与行结尾不匹配。[Tested in Notepad++ 5.8.5]: a regular expression search with an explicit
\\r
or\\n
does not work (contrary to the Scintilla documentation ) . [在Notepad ++ 5.8.5中测试]: 使用显式\\r
或\\n
的正则表达式搜索不起作用(与Scintilla文档相反) 。
Neither does a search on an explicit (pasted) LF, or on the (invisible) EOL characters placed in the field when an EOL is selected. 当选择EOL时,也不会搜索显式(粘贴)LF或放置在字段中的(不可见)EOL字符。 Advanced search ( Ctrl + R ) without regexp 没有正则表达式的高级搜索( Ctrl + R )Ctrl + M will insert something that matches newlines. Ctrl + M将插入与换行符匹配的内容。 They will be replaced by the replace string. 它们将被替换字符串替换。
I recommend this method as the most reliable, unless you really need to use regex. 我建议这种方法最可靠,除非你真的需要使用正则表达式。
As an example, to remove every second newline in a double spaced file, enter Ctrl + M twice in the search string box, and once in the replace string box. 例如,要删除双倍行距文件中的每个第二个换行符,请在搜索字符串框中输入两次Ctrl + M ,然后在替换字符串框中输入一次。Advanced search ( Ctrl + R ) with Regexp. 使用Regexp进行高级搜索( Ctrl + R )。
Neither Ctrl + M ,
$
nor\\r\\n
are matched. Ctrl + M ,$
和\\r\\n
都不匹配。
The same wiki also mentions the Hex editor alternative : 同样的wiki还提到了Hex编辑器的替代方案 :
- Type the new string at the beginning of the document. 在文档的开头键入新字符串。
- Then select to view the document in Hex mode . 然后选择以十六进制模式查看文档 。
- Select one of the new lines and hit Ctrl + H . 选择一个新行并按Ctrl + H.
- While you have the Replace dialog box up, select on the background the new replacement string and Ctrl + C copy it to paste it in the Replace with text input. 当您有“替换”对话框时,在背景上选择新的替换字符串,然后按Ctrl + C复制它以将其粘贴到“替换为文本”输入中。
- Then Replace or Replace All as you wish. 然后根据需要更换或全部替换。
Note: the character selected for new line usually appears as
0a
. 注意:为新行选择的字符通常显示为0a
。
It may have a different value if the file is in Windows Format. 如果文件是Windows格式,则它可能具有不同的值。 In that case you can always go toEdit -> EOL Conversion -> Convert to Unix Format
, and after the replacement switch it back andEdit -> EOL Conversion -> Convert to Windows Format
. 在这种情况下,您可以随时转到Edit -> EOL Conversion -> Convert to Unix Format
,更换后将其切换回来并Edit -> EOL Conversion -> Convert to Windows Format
。
On the Replace dialog, you want to set the search mode to "Extended". 在“替换”对话框中,您要将搜索模式设置为“扩展”。 Normal or Regular Expression modes wont work. 正常或正则表达式模式不起作用。
Then just find "\\r\\n" (or just \\n for unix files or just \\r for mac format files), and set the replace to whatever you want. 然后只需找到“\\ r \\ n”(或只是\\ n用于unix文件或只用\\ r用于mac格式文件),并将替换设置为您想要的任何内容。
I've not had much luck with \\r\\n regular expressions from the find/replace window. 我对查找/替换窗口中的\\ r \\ n正则表达式没有太多运气。
However, this works in Notepad++ v4.1.2: 但是,这适用于Notepad ++ v4.1.2:
Use the "View | Show end of line" menu to enable display of end of line characters. 使用“视图|显示行尾”菜单可以显示行尾字符。 (Carriage return line feeds should show up as a single shaded CRLF 'character'.) (回车换行符应显示为单个着色的CRLF'字符'。)
Select one of the CRLF 'characters' (put the cursor just in front of one, hold down the SHIFT key, and then pressing the RIGHT CURSOR key once). 选择一个CRLF'字符'(将光标放在一个字符前面,按住SHIFT键,然后按一下RIGHT CURSOR键)。
Copy the CRLF character to the clipboard. 将CRLF字符复制到剪贴板。
Make sure that you don't have the find or find/replace dialog open. 确保您没有打开查找或查找/替换对话框。
Open the find/replace dialog. 打开查找/替换对话框。 The 'Find what' field shows the contents of the clipboard: in this case the CRLF character - which shows up as 2 'box characters' (presumably it's an unprintable character?) “查找内容”字段显示剪贴板的内容:在这种情况下,CRLF字符 - 显示为2个'字符'(可能是一个不可打印的字符?)
Ensure that the 'Regular expression' option is OFF. 确保“正则表达式”选项为OFF。
Now you should be able to count, find, or replace as desired. 现在,您应该能够根据需要进行计数,查找或替换。
使用高级搜索选项( Ctrl + R )并使用CRLF的键盘快捷键( Ctrl + M )插入回车符。
Uniapp HBuilderX 打包app一,项目启动(1).创建打包文件:文件》新建》项目(2).选择:5+App》修改项目名称》修改地址》点击创建二.运行打包项目,将生成的页面及css,js等相关文件,填充在刚刚已经创建好的空打包文件中:三,右键点击manifest.json进行文件配置:(1).注册DCould账号,获取DCould_AppID修改相关应用名称,应用版本名称,应用版本号。(2),勾选允许x86(3)修改app的图标四,打包Android app(
网上有人说,那个小黑点在打印出来的时候不会显示,不过如果不想让它们显示的话,也是可以的。方法如下: 1.在word2010中点击"文件",如图: 2.选择“选项”,弹出“word选项”,如图:3.点击“显示”,如图:把“段落标记”前面的对勾取消,点击“确定”就可以了。
原因:大文件存在没有被提交的commit记录里面解决方案:删除有大文件的commit记录即可我的解决流程1 git status 产看未被传送到远程代码库的提交次数2 git cherry -v 查看未被传送到远程代码库的提交描述和说明3 git reset commit_id 撤销未被传送到远程代码库的提交git status git cherry -v git reset 18...
重点内容window的复制粘贴:Ctrl+C,Ctrl+Vlinux的复制粘贴:Ctrl+shift+C,Ctrl+shift+V1、安装VMware Tools 如果是未安装应该显示为 “安装VMware Tools”,点下去。 稍等一会会弹出界面 主要就是那份.gz的安装包。 2、复制到tmp,解压cp VMwareTools-10.1.6-5214329.tar.gz /tmp
我们在日常开发中,经常需要对字符串进行删除截取增加的操作,我们这次说一下使用JavaScript截取指定位置的字符串。**一、使用slice()截取**slice()方法可以通过指定的开始和结束位置,提取字符串的某个部分,并以新的字符串返回被提取的部分。它的参数有两个,start和end。start是必须填写的参数,规定从何处开始选取,如果是负数,就是从尾部倒着开始算。end是可选填写的参数,规定从何处结束选择,如果没有指定end的值的话,只有start,那么就是默认从start一直截取到结束的
数据源:在以下链接下载酒类化学成分数据,分为红酒,白酒两种数据文件,红酒和白酒在化学成分上有较明显的差异http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/分析过程:# 1)先将两组数据混合为一组# 导入数据源redwhite# 增加新字段type,1-红酒,2-白酒
[email protected]:~$ cd [email protected]:~/Desktop$ bash Anaconda3-5.2.0-Linux-x86_64.shWelcome to Anaconda3 5.2.0In order to c...
一、方案设计原理图设计、PCB layout。方案规划的目标(产品、PCBA)必须满足接触 ESD≧±4K 和空气 ESD≧±8K。原理图和 PCB 上需对天线进行保护,有以下措施:1、原理图上 RF 天线优先选择“双极性或 PIFA”天线。2、靠近天线端添加双向 TVS 管(如图 3),且双向 TVS 管至少要满足图 4 特性,表 1 提供 3 种双向 TVS管型号,(双极性或 PIFA 天线方案可根据产品实测的静电能力,满足目标的可 NC)。...
#Oracle的连接字符串,其中包含了Oracle的地址,SID,和端口号CONNECTURL=jdbc:oracle:thin:@20.135.60.21:1521:DWRAC2#使用的用户名ORACLENAME=kkaa#使用的密码ORACLEPASSWORD=kkaa123#需要从Oracle中导入的表名oralceTableName=
1 create database cookbbook 2 on primary( 3 name='cookbook_mdf', 4 filename='F:\我的数据库\cookbook\cookbook.mdf', 5 size=5mb, 6 maxsize=50mb, 7 ...
开发ROS程序的过程中,有时需要给程序加一个Qt界面以方便操作,对于一个刚刚创建的ROS程序来说,添加qt界面需要对cmakelist.txt文件配置很多东西,许多人难就难在不会修改对应的cmakelist.txt文件上,下面是我根据网上资料整理的一份ROS+Qt5的工程创建方法,包括了从创建一个最基础的ros空间到添加界面的全过程。系统环境:ubuntu16.04 ros版本:kineti...
今天意外发现桌面上出现了一个空白图标,对之点击右键则只有剪切、创建快捷方式、删除这几项,点击删除,确实不见了,但是回收站没有显示有东西,刷新桌面后这个空白图标又出现了。用资源管理器看这个图标,发现疑点(下图紫框处字符),回想起来好像用过某款软件清理桌面不常用的图标,会不会是诱因呢?因为这个字符是在注册表里面常见的,所以进注册表搜索了一下(桌面的话可以不用搜索,直接进入相应的键值HKEY_LOCAL...