如何为每10个逗号替换新行

时间:2019-03-29 15:41:45

标签: notepad++

在notepad ++文档中,我有一组用逗号分隔的数字。  我想在每10个逗号/或10个数字后设置一个新行。我该怎么办?

有此列表

19406,20894,21138,21140,21142,21775,22097,34420,35455,35873,35892,35965,37373,37378,37380,37391,37398,37404,37406,37452,37454,37456,37849,37861,38080,39039,42445

下面需要。

19406,20894,21138,21140,21142,21775,22097,34420,35455,35873,
35892,35965,37373,37378,37380,37391,37398,37404,37406,37452,
37454,37456,37849,37861,38080,39039,42445

1 个答案:

答案 0 :(得分:0)

  • Ctrl + H
  • 查找内容:^(?:\d+,){10}\K
  • 替换为:\n#您可以将\r\n用于Windows换行符
  • 检查环绕
  • 检查正则表达式
  • 全部替换

说明:

^       # beginning of line
(?:     # non capture group
  \d+   # 1 or more digits
  ,     # a comma
){10}   # end group, appears 10 times
\K      # forget all we have seen until this position