如何刪除空行
要點
- 貼上
- 刪除空行
- 複製
Text copied from PDFs or emails, and Excel columns, can contain many empty lines. "Remove empty lines" in Remove Duplicate Lines and Sort a List takes them out all at once.
步驟
- Paste the text into "Before tidying (one per line)".
- Tick "Remove empty lines".
- If needed, also choose "Remove spaces at the start and end of lines".
- Check "After tidying" and copy with "Copy result".
Lines containing only spaces may look empty yet not be treated as empty lines. Choosing "Remove spaces at the start and end of lines" together removes them.
Why empty lines increase
- Copying from a PDF inserts empty lines at page and paragraph breaks
- Email quoting inserts empty lines
- Pasting empty Excel cells gives empty lines
- Line breaks pile up as you edit
Combining with "Remove spaces at the start and end of lines"
To remove lines of only spaces, choose both "Remove spaces at the start and end of lines" and "Remove empty lines". The spaces go first, leaving empty lines, which are then deleted.
If you want to keep empty lines
If you want empty lines kept as paragraph breaks, do not choose this option. Paragraph breaks would disappear too.
適合
- Tidying text copied from a PDF
- Pasting an Excel column and removing empty cells
- Eliminating empty lines in the middle of a list
示例
Pasting one Excel column left many empty cells, with 18 of 50 lines empty. "Remove empty lines" tidied it to 32 lines.
Common stumbling blocks
- Empty lines do not go: spaces are in them. Also choose "Remove spaces at the start and end of lines".
- All paragraphs joined: even the paragraph empty lines were removed.
- Line breaks mid-sentence: use the line-break tidying tool.
Frequently asked questions
How do I remove the line breaks themselves?
There is a separate tool that removes line breaks in text.
小結
Remove just the empty lines. For lines of only spaces, also choose the option that removes spaces.
使用「刪除重複行並排序」(免費)搭配使用的工具
- 刪除和整理文字中的換行:整理從 PDF 等處複製的文字中的換行。
- 文字數統計(用於求職申請表和報告):統計文字的字數、行數和稿紙張數。
- 全形、半形、平假名、片假名互相轉換:全形與半形、平假名與片假名互相轉換。