CSV 轉 JSON

在相應的資料表示、格式或計量單位之間执行“CSV 轉 JSON”。

輸入: 文本結果: 結構化 JSON

文本輸入

執行後查看結果

範例

Convert a support-ticket export containing commas, quotes and a multiline note

Demonstrate why splitting on commas or newlines corrupts a valid CSV record.

輸入

ticketsummarynotes
00123Refund, partialCustomer said "please check" Second line

Download input file

Expected answer

JSON
[
    {
        "ticket": "00123",
        "summary": "Refund, partial",
        "notes": "Customer said \"please check\"\r\nSecond line"
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
A compact feature-flag record

輸入

compactschema
true0

Download input file

Expected answer

JSON
[
    {
        "compact": "true",
        "schema": "0"
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
A UTF-8 café label

輸入

namecity
caféParis

Download input file

Expected answer

JSON
[
    {
        "name": "café",
        "city": "Paris"
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
A negative sensor reading

輸入

stationcelsius
demo-12

Download input file

Expected answer

JSON
[
    {
        "station": "demo",
        "celsius": "-12"
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
A decimal checkout amount

輸入

amountcurrency
12.5EUR

Download input file

Expected answer

JSON
[
    {
        "amount": "12.5",
        "currency": "EUR"
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
A missing avatar

輸入

useravatar
demo

Download input file

Expected answer

JSON
[
    {
        "user": "demo",
        "avatar": ""
    }
]
Cell delimiters
,
行 delimiters
\r\n
格式
Array of dictionaries
Array of arrays

輸入

ABCDEF
123456
,;'"
"hello"a"1multi lineend

Download input file

Expected answer

JSON
[
    [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F"
    ],
    [
        "1",
        "2",
        "3",
        "4",
        "5",
        "6"
    ],
    [
        ",",
        ";",
        "'",
        "\"",
        "",
        ""
    ],
    [
        "\"hello\"",
        "a\"1",
        "multi\r\nline",
        "",
        "",
        "end"
    ]
]
Cell delimiters
,
行 delimiters
格式
Array of arrays
Array of dictionaries

輸入

ABCDEF
123456
,;'"
"hello"a"1multi lineend

Download input file

Expected answer

JSON
[
    {
        "A": "1",
        "B": "2",
        "C": "3",
        "D": "4",
        "E": "5",
        "F": "6"
    },
    {
        "A": ",",
        "B": ";",
        "C": "'",
        "D": "\"",
        "E": "",
        "F": ""
    },
    {
        "A": "\"hello\"",
        "B": "a\"1",
        "C": "multi\r\nline",
        "D": "",
        "E": "",
        "F": "end"
    }
]
Cell delimiters
,
行 delimiters
格式
Array of dictionaries

相关工具

資料格式

操作参考

查看原始技术文檔 (English)