notepad++ - 每5行合并一次
问题描述
我需要将每 5 行合并为 1。我有一个包含 1000 行示例的 wordlist 字典:
line 1
line 2
.
line 1000
我需要每 5 行组合一次:
line 1 line 2 line 3 line 4 line 5
.
line 996 line 997 line 998 line 999 line 1000
解决方案
- Ctrl+H
- 找什么:
^(.+)\R(.+)\R(.+)\R(.+)\R
- 用。。。来代替:
$1 $2 $3 $4
- 检查环绕
- 检查正则表达式
- 不要检查
. matches newline
- Replace all
解释:
^ : beginning of line
(.+) : group 1, 1 or more any character
\R : any kind of line break
: same pattern occurs 4 times.
替代品:
$1 : content of group 1
: a space
: same for other groups
推荐阅读
- python - 我在运行“sudo apt autoremove python”时删除了我的数据库
- r - 使用 R 进行网页抓取 Steam 评论
- ansible - ansible playbook - 如何避免多次包含var文件
- c# - 将对象转换为没有泛型的类型
- node.js - 在 Heroku 上以 SPA 模式部署 Nuxt 应用程序
- c# - Entity Framework Core 3 模拟 PARTITION BY
- r - 如何在 R 中不同数据组的连续行之间连接?
- javascript - 将 JSON 值保存在 Expo React Native 变量中
- polygon - 从给定的线和纬度绘制多边形
- icons - Ubuntu 18.04 上的 FLTK:在 Dock 上设置图标的弹出文本