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.tsv7cc4332dafc0b5b4c4195f617a859b053ad974c5fb6e11c51ca907d469cfd79fData
表形式データをタブ区切りで表すテキスト形式。CSVよりフィールド内のカンマに強い形式です。
69 6E 64 65 78 09 index.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 == SIGNATUREconst SIGNATURE = [0x69, 0x6e, 0x64, 0x65, 0x78, 0x09];
const OFFSET = 0;
// bytes: a Uint8Array / Buffer holding the start of the file
export function isTsv(bytes) {
return SIGNATURE.every((byte, i) => bytes[OFFSET + i] === byte);
}package fileid
import "bytes"
var istsvSignature = []byte{0x69, 0x6e, 0x64, 0x65, 0x78, 0x09}
const istsvOffset = 0
func IsTsv(b []byte) bool {
end := istsvOffset + len(istsvSignature)
if len(b) < end {
return false
}
return bytes.Equal(b[istsvOffset:end], istsvSignature)
}const SIGNATURE: &[u8] = &[0x69, 0x6e, 0x64, 0x65, 0x78, 0x09];
const OFFSET: usize = 0;
fn is_tsv(bytes: &[u8]) -> bool {
bytes.get(OFFSET..OFFSET + SIGNATURE.len()) == Some(SIGNATURE)
}<?php
$signature = "\x69\x6e\x64\x65\x78\x09";
$offset = 0;
function is_tsv(string $bytes): bool {
global $signature, $offset;
return substr($bytes, $offset, strlen($signature)) === $signature;
}Tab-Separated Values はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。
形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。
11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。
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.tsv7cc4332dafc0b5b4c4195f617a859b053ad974c5fb6e11c51ca907d469cfd79fFlower 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.tsv0735f1405d078609c577301426738e9910f9a722a87df1d2caad414ec9425f73Navy 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.tsv3ef298ff2d0763a28872e550a787cd802969f80490489252e1060716b60c0ac2Nature 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.tsv6b632fa9c3048f3ecaebeebd903466fc08c6258907f8ccb925fceff47edad489Sky 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.tsv2bf7cd4e735c8856998b0676885278ecde0b314739fd4ac48cb6612d885154b5Starry 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.tsv3d4a3cfa3c78c4d7e6b533b9f104f32ff99abb28347cabe524b1f363c7438132Blue 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.tsvb9093471f57aff1e15183fd8ae1263fe29dc9525c4f2c1e3ee5205278d25db66Hibiscus 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.tsved4ae8b7f1364176e4e4f00844ccecfffb4d70036b885b8ecb918ababf876c24Arctic 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.tsv03fd96063f64b6e2cb93d0097061f53315facc0d42ba2369e08220e88d4d5d9eSunset 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.tsv8e269dc9224d702ca825587b5458e59f48ce95bf2228b66e1aaba2faf7a3affaNASA 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.tsv4cfbcc778162f9ff078783ff8c5cbf6cbdf2dff658e3af5e3e525c20eea44605Tab-Separated Values ファイルはバイトシグネチャ 69 6E 64 65 78 09 ("index.") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。
Tab-Separated Values のMIMEタイプは text/tab-separated-values です。
Tab-Separated Values ファイルは .tsv, .tab 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。