You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Notepad++移除换行并每150字符后新增换行?

Notepad++ Guide: Merge Lines & Split into 150-Character Chunks

Here's a straightforward, step-by-step walkthrough to get your text formatted exactly how you need it:

Step 1: Remove All Line Breaks (Merge into a Single Line)

  • Open your 20-line file in Notepad++.
  • Hit Ctrl+H to bring up the Replace tool.
  • In the "Find what" box, type \r\n (this targets Windows-style line endings; if that doesn’t work, try \n for Unix-style).
  • Leave the "Replace with" box completely empty (no spaces, nothing).
  • Under "Search Mode", select Extended (this enables Notepad++ to recognize the line break escape codes).
  • Click Replace All – all your lines will merge into one continuous 1000-digit string.

Step 2: Split Every 150 Characters with a New Line

  • Keep the merged text open, and re-open the Replace tool (Ctrl+H).
  • Switch "Search Mode" to Regular expression.
  • In "Find what", enter (.{150}) – this regex captures every block of 150 consecutive characters.
  • In "Replace with", enter $1\r\n – $1 inserts the captured 150-character chunk, and \r\n adds a line break right after it.
  • Click Replace All – your text will now split into lines of 150 characters (with the final line being 100 characters, since 1000 isn’t a perfect multiple of 150).

Quick check: After step 2, you should have 7 lines total (6 lines of 150, 1 line of 100).

内容的提问来源于stack exchange,提问作者inin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:37:00