判定できるファイルの種類と限界
この記事のポイント
- 対応する種類を知る
- 限界を知る
- 別の方法も使う
ファイルの種類を判定する は、よく使う形式を中心に、判定します。
手順
- 画像・PDF・Office・ZIP・音声などを判定できる
- 対応していない形式は、「不明」になる
- 不明のときは、ファイルをくれた人に確認する
同じ「テキスト」でも、CSVかJSONかなどは、区別しません。
ファイルの種類を判定する(拡張子と中身の確認)を使う(無料)
あわせて使えるツール
- ファイルのハッシュ値を調べる(SHA-256):ファイルのハッシュ値を調べて、照合します。
- ZIPを開く(解凍):ZIPの中身を見て、ほしいファイルだけ取り出します。
- 文字コードを変換する(文字化けを直す):Shift_JIS・UTF-8・EUC-JPなどの文字コードを変換し、文字化けを直します。
同じツールの、ほかの解説
Which Types Can Be Detected and the Limits
Key points
- Know the supported types
- Know the limits
- Use other methods too
Check a File's Real Type focuses on commonly used formats.
Steps
- Images, PDF, Office, ZIP, audio and more are detected
- Unsupported formats show "Unknown"
- If unknown, ask whoever gave you the file
Text files are not told apart further, such as CSV vs JSON.
Use "Check a File's Real Type (Extension vs Contents)" (free)
Tools that go well with this
- Check a File's Hash (SHA-256): Calculate a file's hash and compare it.
- Open a ZIP File (Unzip): See what is inside a ZIP and extract the files you need.
- Convert Text Encoding (Fix Garbled Text): Convert text files between Shift_JIS, UTF-8, EUC-JP and more to fix garbled text.