Block scalar note
- Input
- CSV row included "line one\nline two" in the note column and an empty trailing cell.
- Output
- YAML wrote note: |- followed by indented line one and line two, then empty: null for the blank cell.
CSV to YAML turns each parsed CSV row into one YAML sequence item, with multiline fields written as block scalars when the YAML writer chooses that style.
From real runs
| Element | Result | What happens |
|---|---|---|
| Row shape | Changed | Each CSV record became one item in a YAML sequence keyed by the CSV headers. |
| Multiline notes | Changed | The note line one and line two was serialized as a YAML block scalar with the |- indicator. |
| Empty cells | Changed | Blank CSV cells became null in YAML, including the missing cells from the ragged final row. |
| Quoted thousands value | Kept | The quoted 1,234.50 amount stayed text in YAML because the comma prevented simple numeric inference. |
| Boolean values | Changed | true and false source strings became YAML booleans without quotes. |
| Date text | Changed | ISO-looking dates were emitted as full UTC timestamp values rather than the shorter source strings. |
Each CSV record became one item in a YAML sequence keyed by the CSV headers.
The note line one and line two was serialized as a YAML block scalar with the |- indicator.
Blank CSV cells became null in YAML, including the missing cells from the ragged final row.
The quoted 1,234.50 amount stayed text in YAML because the comma prevented simple numeric inference.
true and false source strings became YAML booleans without quotes.
ISO-looking dates were emitted as full UTC timestamp values rather than the shorter source strings.
We converted our CSV sample (226 B) with Table engine on 2026-09-11. It took 2 ms and produced a 447 B YAML file, 2.0× larger than the input. The engine raised no warnings.
Input · sample.csv · 226 B
4 data rows × 5 columns; header: company,stage,arr,owner,close_date
Output · sample.yaml · 447 B
4 list items, 0 top-level keys, 20 lines
First lines of the output
- company: Northwind Traders
stage: Proposal
arr: 48000
owner: R. Ayers
close_date: 2026-10-14T00:00:00.000Z
- company: Contoso Ltd
stage: Negotiation
arr: 120000
owner: P. Ng
close_date: 2026-09-30T00:00:00.000Z
- company: Fabrikam
stage: Qualified
arr: 22500
owner: R. Ayers
close_date: 2026-11-02T00:00:00.000Z
- company: Tailspin Toys
stage: Won
arr: 64000
…Python csv and PyYAML
python - <<'PY'
import csv, yaml
with open("input.csv", newline="", encoding="utf-8-sig") as f:
rows = list(csv.DictReader(f))
with open("output.yaml", "w", encoding="utf-8") as out:
yaml.safe_dump(rows, out, allow_unicode=True, sort_keys=False)
PYDictReader keeps blanks as empty strings unless you normalize them to None before dumping YAML.
The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=csv&to=yaml.
curl -X POST https://filetypeconverters.com/api/v1/convert \
-H "Authorization: Bearer $FTC_API_KEY" \
-F "file=@input.csv" -F "from=csv" -F "to=yaml" \
-F 'options={"delimiter":","}' \
--output output.yaml| Key | Applies to | Type | Default |
|---|---|---|---|
| delimiter | Reading CSV | string | , |
| header | Reading CSV | boolean | true |
| quote | Reading CSV | string | " |
| encoding | Reading CSV | utf-8 · latin1 | utf-8 |
| delimiter | Writing YAML | string | , |
| newline | Writing YAML | · | |
| sheetName | Writing YAML | string | |
| dialect | Writing YAML | postgres · mysql · sqlite | postgres |
| tableName | Writing YAML | string | data |
| createTable | Writing YAML | boolean | true |
Our table engine maps blank cells to null before YAML serialization. That makes missing data explicit, but it differs from an empty string value.
Our sample note became a block scalar using |-. That format keeps the line break readable while still representing one field.
Yes for the rows we tested. The YAML writer followed the header order from the CSV table when writing each sequence item.