空行をまとめて消す方法
- 貼り付ける
- 空行を消す
- コピーする
PDFやメールからコピーした文章、Excelの列には、空の行がたくさん入っていることがあります。重複した行を消す・並べ替える の「空行を消す」で、まとめて取り除けます。
手順
- 「整える前(1行に1つ)」に、文章を貼り付けます。
- 「空行を消す」にチェックを入れます。
- 必要なら、「行の前後の空白を消す」も選びます。
- 「整えた後」を確認し、「結果をコピー」でコピーします。
空行が増える原因
- PDFからコピーすると、ページの区切りや段落で空行が入る
- メールの引用で、空行が入る
- Excelの空のセルを貼り付けると、空行になる
- 文章を編集するうち、改行が重なる
「行の前後の空白を消す」との組み合わせ
空白だけの行を消したいときは、「行の前後の空白を消す」と「空行を消す」の両方を選びます。先に空白が消えて、空行になり、そのあと削除されます。
空行を残したい場合
文章の段落の区切りとして、空行を残したい場合は、このオプションを選ばないでください。段落の区切りまで消えてしまいます。
向いている場面
- PDFからコピーした文章を整える
- Excelの列を貼り付けて、空のセルを取り除く
- リストの途中の空行を、なくす
例
Excelの1列を貼り付けたら、空のセルが多く、50行中18行が空行だった。「空行を消す」で、32行に整った。
つまずきやすい点
- 空行が消えない:スペースが入っている。「行の前後の空白を消す」も選ぶ。
- 段落が全部つながった:段落の空行まで消えた。
- 文の途中で改行されている:改行を整えるツールを使う。
よくある質問
改行そのものを消すには?
文章の改行を消すツールが、別にあります。
まとめ
空行だけを消す。空白だけの行は、空白を消すオプションも併せて選びます。
重複した行を消す・並べ替えるを使う(無料)あわせて使えるツール
- 文章の改行を消す・整える:PDFなどからコピーした文章の改行を整えます。
- 文字数カウント(エントリーシート・レポート用):文章の文字数・行数・原稿用紙の枚数などを数えます。
- 全角・半角、ひらがな・カタカナを変換する:全角・半角、ひらがな・カタカナを変換します。
同じツールの、ほかの解説
How to Remove Blank Lines
- Paste
- Remove blank lines
- Copy
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.
Steps
- 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".
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.
Good for
- Tidying text copied from a PDF
- Pasting an Excel column and removing empty cells
- Eliminating empty lines in the middle of a list
Example
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.
Summary
Remove just the empty lines. For lines of only spaces, also choose the option that removes spaces.
Use "Remove Duplicate Lines and Sort a List" (free)Tools that go well with this
- Remove and Tidy Line Breaks in Text: Tidy line breaks in text copied from PDFs and elsewhere.
- Character Counter (for Applications and Reports): Count characters, lines and manuscript sheets of your text.
- Convert Full-Width, Half-Width, Hiragana and Katakana: Convert full-width/half-width and hiragana/katakana.