Aller au contenu
Agentic Workflowdocs
v0.8.2Installer gratuitement

nœuds / builtin / datatransformation

CSV

Convert between CSV text and items

Données ExtensionApplication web

Ce contenu n’est pas encore disponible dans votre langue.

Read CSV text into items, one per row, or turn items into CSV text.

workflow · table-to-csv.awf 4 étapes

Page Table to CSV : un workflow de 4 étapes, qui commence par When Started et se termine par Copy to clipboard.

Ouvrir dans AWFlow

CSV works in two directions, chosen with Operation:

  • Parse into items reads CSV (or TSV) text and outputs one item per row, with the header names as field names. All values come out as text.
  • Build from items takes all incoming items and writes them into one CSV text, one row per item.

It reads real-world CSV correctly: commas inside quoted values stay part of the value, a quoted value can span several lines, and "" inside quotes means one quote character. Messy files are handled rather than rejected:

  • A short row leaves its missing columns empty. A long row keeps the extra values as column4, column5 and so on.
  • A repeated header name is made unique (a second price becomes price_2), and an empty header cell is named by position (column1).
  • An invisible byte order mark at the start of the file is removed, and both Windows and Unix line endings work.

When building, a value is quoted only when it needs it (it contains the delimiter, a quote, a line break, or leading or trailing spaces). Empty values become empty cells, and lists or objects are written as JSON. Columns are every field found across all items, in the order they first appear. Lines end with Windows line endings, which Excel expects.

  • Read a spreadsheet export or a CSV returned by an API into items you can filter and sort.
  • Produce CSV text from scraped items, to save with Save as File or send in a message.
  • To get a CSV file (for an upload or attachment) instead of text, use Convert to File with Format CSV.
RéglageTypeCe que cela fait
Operation ChoiceWhich direction to convert. Options: Parse into items, Build from items. Par défaut : Parse into items
CSV Text ValueThe CSV to parse. Leave empty to read from a field instead.
Source Field TextField holding the CSV text, when the field above is left empty.
Delimiter ChoiceCharacter separating the fields. Options: Comma, Semicolon, Tab, Pipe. Par défaut : Comma
First Row Is A Header ToggleWhether the first row names the columns. Par défaut : On
Write A Header Row ToggleWhether the built CSV starts with a row naming the columns. Par défaut : On
Columns TagsColumns to write, in order. Left empty, every field is written.
Trim Fields ToggleRemove surrounding whitespace from every parsed value. Par défaut : Off
Skip Blank Rows ToggleDrop rows that are entirely empty. Par défaut : On
Quote Every Field ToggleQuote every field, not only those that need it. Par défaut : Off
Add Byte Order Mark ToggleWrite the mark Excel needs to read UTF-8 correctly. Par défaut : Off
Put CSV In Field TextName of the field holding the built CSV text. Par défaut : csv
  • For parsing: put the text in CSV Text (for example {{ $input.body }}), or leave it empty and name the field that holds it in Source Field. Turn off First Row Is A Header when the file has no header; the columns are then named column1, column2 and so on.
  • For building: Columns picks which fields to write and in what order. Write A Header Row, Quote Every Field, Add Byte Order Mark and Put CSV In Field apply only here.
  • Choose Tab in Delimiter for TSV, and Semicolon for many European Excel exports.
  • Output
  • Parse into items outputs one item per data row, such as { "name": "Ada", "city": "London" }. A file with only a header gives no items, not an error.
  • Build from items outputs one item with the CSV text in Put CSV In Field, read downstream with {{ $input.csv }}.

None. This node needs no connection and has no slots for other nodes.

  1. HTML Extract reads a table of products from a page, one item per row.
  2. CSV with Operation Build from items, Columns name, price, url, and Add Byte Order Mark on, since the file will be opened in Excel.
  3. Save as File with Content {{ $input.csv }}, File name products and File type csv downloads the file.
  • “No CSV to parse. Fill in the CSV text, or name the field holding it on the incoming item.” Both CSV Text and Source Field are empty.
  • “Field “…” does not hold CSV text on the incoming item.“ The field in Source Field is missing or is not text. Check its name in the previous node’s output.
  • “No items to build CSV from. Connect a node that produces items.” Nothing reached the node when building.
  • Everything lands in one column. The file uses another separator. Change Delimiter to Semicolon, Tab or Pipe.
  • Accented letters look garbled in Excel. Turn on Add Byte Order Mark when building.
Copy any table on a page as CSV débutant · 3 min Aucune configuration
Modifier cette page

Dernière mise à jour :

Was this page useful?
Demander à Aria à propos de CSV