大文字小文字や空白を無視して比べる
- 選ぶ
- 比べる
2つの文章を比べると、大文字と小文字の違いや、行の前後の空白のせいで、本来の違いではない部分まで、差分に出てしまいます。2つの文章の違いを調べる の2つのオプションで、それらを無視して比べられます。
手順
- 「文章A(前)」と「文章B(後)」に、文章を貼り付けます。
- 「大文字と小文字を区別しない」にチェックを入れます。
- 「行の前後の空白を無視する」にチェックを入れます。
- 「比べる」を押して、「違いを見る」を確認します。
「大文字と小文字を区別しない」
「Apple」と「apple」を同じと見なします。英単語の大文字・小文字の違いは、意味の違いでない場合に便利です。
- 向いている場面:英文の比較、メールアドレス、コードの変数名(言語によって注意)
- 向かない場面:大文字・小文字に意味があるデータ(パスワード、コード)
「行の前後の空白を無視する」
行の先頭や末尾にあるスペースやタブを、取り除いて比べます。見えない空白のせいで出る、差分を防げます。
- 向いている場面:コピーしたときに空白が入った文章、字下げの違い
- 向かない場面:字下げに意味があるデータ(Pythonのコード、整形された文章)
無視しても残る違い
- 文字の違い(言葉が変わったなど)
- 行の追加・削除
- 全角と半角の違い
- 行の途中の空白の違い
オプションの使い分け
- まず、オプションなしで比べる:すべての違いを見る。
- 差分が多すぎるとき、オプションを使う:本質的でない差を除く。
- 最終確認は、オプションなしで:細かな違いも見逃さない。
向いている場面
- 英文の校正前後の比較
- コピーで空白が入った文章の比較
- 字下げが変わっただけのコードの比較
例
英語のメールの下書きを、2つ比べた。大文字・小文字の差が多かったため、区別しないに設定。本当に変わった文だけが、表示された。
つまずきやすい点
- 日本語には、大文字・小文字がない:日本語の比較では、効果がない。
- 空白の無視で、意味が変わるデータを見逃す:重要な比較は、オプションなしで確認する。
よくある質問
全角と半角の違いも無視できますか?
できません。事前に、全角・半角を整えるツールで、そろえてください。
まとめ
大文字・小文字と、前後の空白は、無視できる。ただし、最終確認は、オプションなしで。
2つの文章の違いを調べるを使う(無料)あわせて使えるツール
- 2つのPDFの違いを比べる(差分チェック):2つのPDFの文字の違いを、色分けして表示します。
- 重複した行を消す・並べ替える:重複した行を消して、並べ替えます。
- 文字数カウント(エントリーシート・レポート用):文章の文字数・行数・原稿用紙の枚数などを数えます。
同じツールの、ほかの解説
Comparing While Ignoring Case or Spaces
- Choose
- Compare
When comparing two texts, differences in case and in spaces at the start or end of lines produce differences that aren't the real ones. The two options in Compare Two Texts (Diff) let you ignore them and compare.
Steps
- Paste text into "Text A (before)" and "Text B (after)".
- Tick "Ignore case".
- Tick "Ignore spaces at the start and end of lines".
- Press "Compare" and check "See the differences".
"Ignore case"
Treats "Apple" and "apple" as the same. Handy when case differences in English words don't change the meaning.
- Suited: comparing English text, email addresses, variable names in code (take care depending on the language)
- Not suited: data where case matters (passwords, code)
"Ignore spaces at the start and end of lines"
Removes spaces and tabs at the beginning or end of lines before comparing. Prevents differences caused by invisible spaces.
- Suited: text that picked up spaces when copied, differences in indentation
- Not suited: data where indentation matters (Python code, formatted text)
Differences that remain even when ignored
- Differences in characters (words changed and so on)
- Added or removed lines
- Full-width versus half-width differences
- Differences in spaces mid-line
Using the options
- First compare without options: see all differences.
- When there are too many differences, use options: remove non-essential gaps.
- Do the final check without options: don't miss fine differences.
Good for
- Comparing English text before and after proofreading
- Comparing text that picked up spaces from copying
- Comparing code where only indentation changed
Example
Compared two drafts of an English email. Case differences were many, so set to ignore case. Only the sentences that really changed were shown.
Common stumbling blocks
- Japanese has no upper/lower case: no effect when comparing Japanese.
- Ignoring spaces hides meaningful changes in data: check important comparisons without options.
Frequently asked questions
Can full-width/half-width differences be ignored too?
No. Align them beforehand with the tool that tidies full-width and half-width.
Summary
Case and surrounding spaces can be ignored. But do the final check without options.
Use "Compare Two Texts (Diff)" (free)Tools that go well with this
- Compare Two PDFs (Find Differences): Show the text differences between two PDFs, color-coded.
- Remove Duplicate Lines and Sort a List: Remove duplicate lines and sort them.
- Character Counter (for Applications and Reports): Count characters, lines and manuscript sheets of your text.