仅在特定行#(REGEX)上替换一个单词
在一个大文件中,我需要仅在特定行上替换一个单词。说,在第25、55、181、1448行上,大约2000次。
我开始使用“ to”行并替换单词手动进行操作。即使我必须更改每个实例的值,是否有一种方法可以自动进行操作?它仍然会更快。
Within a large file I need to replace one word only on specific lines. Say, on line 25, 55, 181, 1448, and so forth about 2000 times.
I started doing it manually using "go to" line and replacing the word. Is there a way to do it automatically, even if I have to change the value for every instance? It will still be faster.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以尝试这样的事情:
其中5是以前的行。所以5表示您想获得第6行。
工作示例:
https://regex101.com/r/qudon0/1
Maybe you can try something like this:
Where 5 are the previous lines. So 5 means you want to get line number 6.
Working Example:
https://regex101.com/r/QuDon0/1