Conversor de YAML a CSV
Convierte listas YAML en CSV o TSV, y convierte datos CSV de vuelta a YAML. Un uso típico es mover configuración o datos de prueba entre un archivo YAML y una hoja de cálculo sin editar a mano.
The format chain continues with the CSV to JSON Converter and the YAML to JSON Converter. To confirm the source parses before conversion, the YAML Validator is the check.
Cómo usar YAML a CSV
- 1 Paste your YAML.
- 2 Choose which key names the rows, if it is a list of mappings.
- 3 Set the delimiter and whether to include a header.
- 4 Download the CSV.
Cómo funciona
El analizador YAML lee mapeos y secuencias de bloque por indentación, entiende escalares entrecomillados y sin entrecomillar, colecciones en línea [a, b] y {k: v}, escalares de bloque (| y >) y comentarios. Las listas de objetos se convierten en filas CSV con la unión de todas las claves como columnas.
- Direcciones YAML a CSV y CSV a YAML
- Listas de objetos, listas de listas u objetos individuales
- Escalares entrecomillados, colecciones de flujo y escalares de bloque
- Delimitador y cabecera configurables
- Copia o descarga cualquiera de los dos formatos
Preguntas frecuentes
What YAML shapes convert cleanly to CSV?
A list of mappings with consistent keys, which is the same shape a JSON array of objects has. Anything else — nested structures, scalars at different levels, lists of scalars — requires a flattening decision that will lose information if it is made carelessly.
How are nested keys handled?
By flattening into dotted column names, which preserves the data in a form that can be unflattened. The alternative is to serialise the nested structure into a single cell, which is lossless but not directly usable in a spreadsheet. Which is appropriate depends on what will consume the file.
Why does my output have far more columns than expected?
Because the union of keys across all rows is wider than any single row. If records vary in which fields they carry, the header contains every field any of them has, and each row leaves the others empty. That is correct behaviour for a lossless conversion, though it can produce a sparse file.
Herramientas para desarrolladores relacionadas
También te puede interesar
Herramientas de otras categorías que suelen combinarse con YAML a CSV: