file in abyss
フォーマット一覧へ戻る

Data

TSV Tab-Separated Values

表形式データをタブ区切りで表すテキスト形式。CSVよりフィールド内のカンマに強い形式です。

Extensions .tsv, .tab
MIME text/tab-separated-values

マジックナンバー

ファイルを解析
オフセット 0 このサイトのTSVサンプルで使うヘッダ行
69 6E 64 65 78 09
index.

構造

  1. Header row
  2. Tab-separated records
  3. Line endings

注意点

  • TSV一般には固定マジックナンバーがなく、引用やエスケープ規則も実装により差があります。

判定コード例

SIGNATURE = bytes.fromhex("696e64657809")
OFFSET = 0

def is_tsv(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Tab-Separated Values はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .tsv / .tab という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Tab-Separated Values は 69 6E 64 65 78 09 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Data

Blue Sky TSV

Blue Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.tsv
Type Sample
Small file
133 B
SHA-256 7cc4332dafc0b5b4c4195f617a859b053ad974c5fb6e11c51ca907d469cfd79f
Download
Data

Flower Garden TSV

Flower Garden TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.tsv
Type Sample
Small file
277 B
SHA-256 0735f1405d078609c577301426738e9910f9a722a87df1d2caad414ec9425f73
Download
Data

Navy Blue Sky TSV

Navy Blue Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.tsv
Type Sample
Small file
372 B
SHA-256 3ef298ff2d0763a28872e550a787cd802969f80490489252e1060716b60c0ac2
Download
Data

Nature of the Sky TSV

Nature of the Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.tsv
Type Sample
Small file
451 B
SHA-256 6b632fa9c3048f3ecaebeebd903466fc08c6258907f8ccb925fceff47edad489
Download
Data

Sky Landscape TSV

Sky Landscape TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.tsv
Type Sample
Small file
639 B
SHA-256 2bf7cd4e735c8856998b0676885278ecde0b314739fd4ac48cb6612d885154b5
Download
Data

Starry Sky TSV

Starry Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.tsv
Type Sample
Small file
657 B
SHA-256 3d4a3cfa3c78c4d7e6b533b9f104f32ff99abb28347cabe524b1f363c7438132
Download
Data

Blue Night Sky TSV

Blue Night Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.tsv
Type Sample
Small file
718 B
SHA-256 b9093471f57aff1e15183fd8ae1263fe29dc9525c4f2c1e3ee5205278d25db66
Download
Data

Hibiscus Flower TSV

Hibiscus Flower TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.tsv
Type Sample
1.0 KB
SHA-256 ed4ae8b7f1364176e4e4f00844ccecfffb4d70036b885b8ecb918ababf876c24
Download
Data

Arctic Sky TSV

Arctic Sky TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.tsv
Type Sample
Small file
984 B
SHA-256 03fd96063f64b6e2cb93d0097061f53315facc0d42ba2369e08220e88d4d5d9e
Download
Data

Sunset Rays TSV

Sunset Rays TSV is a Tab-Separated Values sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.tsv
Type Sample
1.1 KB
SHA-256 8e269dc9224d702ca825587b5458e59f48ce95bf2228b66e1aaba2faf7a3affa
Download
Data

NASA Blue Marble TSV

NASA Blue Marble TSV is a Tab-Separated Values sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.tsv
Type Sample
1.7 KB
SHA-256 4cfbcc778162f9ff078783ff8c5cbf6cbdf2dff658e3af5e3e525c20eea44605
Download

よくある質問

Tab-Separated Values のマジックナンバー(ファイルシグネチャ)は?

Tab-Separated Values ファイルはバイトシグネチャ 69 6E 64 65 78 09 ("index.") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Tab-Separated Values のMIMEタイプは?

Tab-Separated Values のMIMEタイプは text/tab-separated-values です。

Tab-Separated Values の拡張子は?

Tab-Separated Values ファイルは .tsv, .tab 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット