<!-- BusyBot node reference — https://busybot.net/tools/extract-from-file/ -->

> Node: Extract from File (`extract_from_file`) · Action (binary) · v1
> Category: Core Nodes · Credentials: none
> Updated: 2026-08-16

# Extract from File

> Extract structured data from binary files (CSV, spreadsheets, PDF, JSON, XML, text, ICS)

## Overview

The Extract from File tool parses binary file data attached to workflow items and converts it into structured JSON output. For tabular formats (CSV, XLSX, XLS, ODS, HTML, RTF), it produces one output item per row — this is a 1:N expansion. For non-tabular formats (PDF, JSON, text, XML, ICS, base64) and for the markdown/OCR operations, it produces one output item per input item (1:1). No credentials required — all parsing is local, apart from the vision-assisted operations, which use an AI model.

**Category:** Core Nodes  
**Tool Name:** `extract_from_file`  
**Version:** 1

**Appearance:** Icon: `lucide-FileOutput` | Color: `#2244FF`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool does not require any credentials.

### Operations

| Operation | Value | Description |
|-----------|-------|-------------|
| Extract From CSV | `csv` | Transform a CSV file into output items |
| Extract From HTML | `html` | Transform a table in an HTML file into output items |
| Extract From ICS | `fromIcs` | Transform an ICS calendar file into output items |
| Extract From JSON | `fromJson` | Transform a JSON file into output items |
| Extract From ODS | `ods` | Transform an ODS file into output items |
| Extract From PDF | `pdf` | Extract content and metadata from a PDF file |
| Extract From RTF | `rtf` | Transform a table in an RTF file into output items |
| Extract From Text File | `text` | Extract the content of a text file |
| Extract From XML | `xml` | Extract the content of an XML file |
| Extract From XLS | `xls` | Transform an Excel XLS file into output items |
| Extract From XLSX | `xlsx` | Transform an Excel XLSX file into output items |
| Move File to Base64 String | `binaryToProperty` | Convert a file into a base64-encoded string |
| PDF to Markdown (Advanced) | `pdfToMarkdown` | Extract PDF to structured markdown with Vision OCR fallback for scanned documents |
| Document to Markdown | `documentToMarkdown` | Convert DOCX, XLSX, PPTX, HTML, EPUB and other documents to markdown |
| Image OCR + Description | `imageOCR` | Extract text via OCR and generate a visual description of the image |

### Parameters

Operations that share a parameter set are documented together.

#### Extract From CSV / HTML / RTF / ODS / XLS / XLSX (`csv`, `html`, `rtf`, `ods`, `xls`, `xlsx`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Options | `collection` | No | `{}` | Parsing options for the tabular file. |
| — Delimiter | `string` | No | `,` | Set the field delimiter for CSV parsing. _(shown when Operation is `csv`)_ |
| — Encoding | `options` | No | `utf-8` | The character encoding of the CSV file. _(shown when Operation is `csv`)_ |
| | | | | Options: `ascii`, `latin1`, `ucs-2`, `ucs2`, `utf-8`, `utf16le`, `utf8` |
| — Exclude Byte Order Mark (BOM) | `boolean` | No | `false` | Whether to detect and exclude the byte-order-mark from the CSV input if present. _(shown when Operation is `csv`)_ |
| — Preserve Quotes | `boolean` | No | `false` | Whether to handle unclosed quotes in CSV fields as part of the field content instead of throwing a parsing error. _(shown when Operation is `csv`)_ |
| — Header Row | `boolean` | No | `true` | Whether the first row of the file contains the header names. _(shown when Operation is `csv`, `html`, `ods`, `xls`, `xlsx`)_ |
| — Include Empty Cells | `boolean` | No | `false` | Whether to include empty cells. They will be filled with an empty string. _(shown when Operation is `csv`, `html`, `ods`, `xls`, `xlsx`)_ |
| — Max Number of Rows to Load | `number` | No | `-1` | Stop handling records after the requested number of rows are read. Use -1 to load all rows. _(shown when Operation is `csv`)_ |
| — Range | `string` | No | — | The range to read from the table. If set to a number it will be the starting row. If set to a string it will be used as A1-style notation range. _(shown when Operation is `ods`, `xls`, `xlsx`)_ |
| — RAW Data | `boolean` | No | `false` | Whether to return RAW data instead of parsing it. _(shown when Operation is `ods`, `xls`, `xlsx`, `html`, `rtf`)_ |
| — Read As String | `boolean` | No | `false` | In some cases and file formats, it is necessary to read as string to ensure special characters are interpreted correctly. _(shown when Operation is `ods`, `xls`, `xlsx`, `html`, `rtf`)_ |
| — Sheet Name | `string` | No | — | Name of the sheet to read from in the spreadsheet. If not set, the first sheet will be used. _(shown when Operation is `ods`, `xls`, `xlsx`)_ |
| — Starting Line | `number` | No | `0` | Start handling records from the requested line number. Starts at 0. _(shown when Operation is `csv`)_ |
| — Skip Records With Errors | `fixedCollection` | No | `{ value: { enabled: false, maxSkippedRecords: -1 } }` | How to handle rows that fail to parse. _(shown when Operation is `csv`)_ |
| — — Enabled | `boolean` | No | `false` | Whether to skip records with errors when reading from file. |
| — — Max Skipped Records | `number` | No | `-1` | The maximum number of records that can be skipped. Set to -1 to remove limit. |

#### Extract From JSON / Text File / XML / ICS and Move File to Base64 String (`fromJson`, `text`, `xml`, `fromIcs`, `binaryToProperty`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Destination Output Field | `string` | Yes | `data` | The name of the output JSON field to place the extracted data in. Supports dot notation for nested paths. |
| Options | `collection` | No | `{}` | Decoding options and what to keep from the input item. |
| — File Encoding | `options` | No | `utf8` | Specify the encoding of the file, defaults to UTF-8. _(shown when Operation is `fromJson`, `text`, `fromIcs`, `xml`)_ |
| | | | | Options: `armscii8`, `ascii`, `base64`, `big5hkscs`, `binary`, `cesu8`, `cp1046`, `cp1124`, `cp1125`, `cp1129`, `cp1133`, `cp1161`, `cp1162`, `cp1163`, `cp437`, `cp720`, `cp737`, `cp775`, `cp808`, `cp850`, `latin1`, `ucs2`, `utf16le`, `utf8` |
| — Strip BOM | `boolean` | No | `true` | Whether to strip the BOM (Byte Order Mark) from the file. _(shown when Operation is `fromJson`, `text`, `fromIcs`, `xml`)_ |
| — Keep Source | `options` | No | `json` | What data from the input item to keep on the output. |
| | | | | Options: `json` (include JSON data of the input item), `binary` (include binary data of the input item), `both` |

#### Extract From PDF (`pdf`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Options | `collection` | No | `{}` | Page handling, password and source-retention settings. |
| — Join Pages | `boolean` | No | `true` | Whether to join the text from all pages into a single string or return an array of text from each page. |
| — Keep Source | `options` | No | `json` | What data from the input item to keep on the output. |
| | | | | Options: `json` (include JSON data of the input item), `binary` (include binary data of the input item), `both` |
| — Max Pages | `number` | No | `0` | Maximum number of pages to include. Set to 0 for all pages. |
| — Password | `string` | No | — | Password for encrypted PDF files. |

#### PDF to Markdown / Document to Markdown / Image OCR (`pdfToMarkdown`, `documentToMarkdown`, `imageOCR`)

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Destination Output Field | `string` | Yes | `data` | The name of the output JSON field to place the extracted data in. Supports dot notation for nested paths. |
| Options | `collection` | No | `{}` | OCR and source-retention settings. |
| — Enable Vision OCR Fallback | `boolean` | No | `true` | For scanned PDFs: if text extraction returns less than 50 characters, render pages as images and read them with a vision model. _(shown when Operation is `pdfToMarkdown`)_ |
| — Max Pages (OCR) | `number` | No | `20` | Maximum number of pages to render for Vision OCR (scanned PDFs only). Higher values increase cost and processing time. _(shown when Operation is `pdfToMarkdown`)_ |
| — Keep Source | `options` | No | `json` | What data from the input item to keep on the output. |
| | | | | Options: `json` (include JSON data of the input item), `binary` (include binary data of the input item), `both` |

#### All Operations

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Input Binary Field | `string` | Yes | `data` | The name of the input binary field containing the file data to be processed. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| Max Concurrency | `number` | No | `10` | Maximum number of items to process concurrently. |

## Output Data

How many items come out, and what is on them, depends on the family the operation belongs to.

### Tabular operations (`csv`, `html`, `rtf`, `ods`, `xls`, `xlsx`)

**One output item per row** — a 1000-row spreadsheet becomes 1000 items. The row replaces the item JSON entirely; the input item's own fields are not merged in. The input binary is forwarded onto every row item, so a downstream node still sees the source file.

With **Header Row** on (the default), each item is an object keyed by the header names:

```json
{
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "signups": 12
}
```

With **Header Row** off, the values arrive positionally under a single `row` array:

```json
{
  "row": ["Ada Lovelace", "ada@example.com", 12]
}
```

A file that parses to zero rows produces **no output items at all** for that input item.

### PDF (`pdf`)

One output item carrying the document's text and metadata:

```json
{
  "numpages": 12,
  "numrender": 12,
  "info": { "Title": "Annual Report", "Author": "Finance" },
  "metadata": {},
  "text": "Page one text…\n\nPage two text…",
  "version": "4.0.379"
}
```

- `text` is a single joined string when **Join Pages** is on, and an array with one entry per page when it is off.
- `numpages` is the document's real page count even when **Max Pages** limited how much text was read.
- `info` is the PDF's own document-info dictionary, or `null` when the file carries none.

### Single-value operations (`fromJson`, `text`, `xml`, `fromIcs`, `binaryToProperty`) and the markdown/OCR operations

One output item, with the extracted value written at **Destination Output Field**. A dotted name such as `document.content` creates the nesting it needs.

| Operation | Value written to the field |
|-----------|----------------------------|
| `fromJson` | The parsed JSON — an object or array, not a string. An empty file yields `{}`, and a file that is not valid JSON fails the item. |
| `text` | The decoded file contents as a string. |
| `xml` | The decoded file contents as a string, left as XML for a downstream parser. |
| `fromIcs` | The parsed calendar as an object. |
| `binaryToProperty` | The file as a base64-encoded string. |
| `pdfToMarkdown`, `documentToMarkdown`, `imageOCR` | The extracted text as a markdown string. |

### Keep Source

**Keep Source** controls what survives from the input item, for every operation that offers it:

| Value | Output JSON | Output binary |
|-------|-------------|---------------|
| `json` | Input fields kept, result added | The source binary property is removed; other binary properties are kept |
| `binary` | Input fields dropped, result only | All input binary kept, including the source |
| `both` | Input fields kept, result added | All input binary kept, including the source |

Dropping the source file with `json` is the default because a parsed file is usually no longer needed and carrying it forward costs storage on every downstream item.

## Usage Examples

- Parse a CSV file into individual row items
- Extract all rows from an Excel XLSX spreadsheet
- Extract text and metadata from a PDF document
- Parse a JSON file from binary data
- Extract XML content from a binary file
- Parse an ICS calendar file into structured events
- Convert a binary file to a base64 string
- Read an ODS spreadsheet with a specific sheet name
- Parse CSV with custom delimiter and encoding

## Example Configuration

Parse a CSV with headers:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "csv",
    "binaryPropertyName": "data",
    "maxConcurrency": 10,
    "options": {
      "delimiter": ",",
      "encoding": "utf-8",
      "headerRow": true,
      "includeEmptyCells": false
    }
  }
}
```

Read a named sheet and a cell range from an Excel workbook:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "xlsx",
    "binaryPropertyName": "excelFile",
    "maxConcurrency": 5,
    "options": {
      "sheetName": "DataSheet",
      "range": "A1:Z100",
      "headerRow": true,
      "maxRowCount": 50
    }
  }
}
```

Extract text from a password-protected PDF, capped at ten pages:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "pdf",
    "binaryPropertyName": "pdfData",
    "maxConcurrency": 3,
    "options": {
      "joinPages": true,
      "maxPages": 10,
      "password": "secret123",
      "keepSource": "json"
    }
  }
}
```

Parse a JSON file into a nested output field:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "fromJson",
    "binaryPropertyName": "jsonFile",
    "destinationKey": "parsedData.content",
    "maxConcurrency": 10,
    "options": {
      "encoding": "utf8",
      "stripBOM": true,
      "keepSource": "json"
    }
  }
}
```

Convert a file to base64 for an API that expects it inline:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "binaryToProperty",
    "binaryPropertyName": "imageFile",
    "destinationKey": "base64Image",
    "maxConcurrency": 10,
    "options": {
      "keepSource": "json"
    }
  }
}
```

Pull the rows out of an HTML table:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "html",
    "binaryPropertyName": "htmlContent",
    "maxConcurrency": 10,
    "options": {
      "encoding": "utf-8",
      "headerRow": true,
      "includeEmptyCells": false
    }
  }
}
```

Read an XML file into a field for a downstream parser:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "xml",
    "binaryPropertyName": "xmlData",
    "destinationKey": "xmlContent",
    "maxConcurrency": 10,
    "options": {
      "encoding": "utf8",
      "stripBOM": true
    }
  }
}
```

Process a spreadsheet, tolerating up to ten bad rows:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "xlsx",
    "binaryPropertyName": "spreadsheetData",
    "maxConcurrency": 5,
    "options": {
      "headerRow": true,
      "includeEmptyCells": false,
      "maxRowCount": 1000,
      "readAsString": false,
      "skipRecordsWithErrors": {
        "value": {
          "enabled": true,
          "maxSkippedRecords": 10
        }
      }
    }
  }
}
```

Turn a scanned PDF into markdown, letting OCR handle image-only pages:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "pdfToMarkdown",
    "binaryPropertyName": "data",
    "destinationKey": "document.markdown",
    "options": {
      "enableOCR": true,
      "maxPages": 20,
      "keepSource": "json"
    }
  }
}
```

Parse an ICS calendar file into structured events:

```json
{
  "type": "extract_from_file",
  "parameters": {
    "operation": "fromIcs",
    "binaryPropertyName": "calendarFile",
    "destinationKey": "events",
    "maxConcurrency": 10,
    "options": {
      "encoding": "utf8",
      "keepSource": "json"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Parse binary files (CSV, XLSX, PDF, JSON, XML, text, ICS) into structured JSON data — tabular formats produce one output item per row.

### Common Patterns

- **Spreadsheet data processing** — use `xlsx` or `ods` with **Header Row** on, cap the run with **Max Number of Rows to Load** while testing, and enable **Skip Records With Errors** for messy exports.
- **Document content extraction** — use `text` with a dotted **Destination Output Field** so the content lands in a tidy nested structure.
- **Calendar data processing** — use `fromIcs` and read the events out of the destination field downstream.

### Choosing a PDF operation

- `pdf` is local, fast and free. Use it for PDFs with a real text layer.
- `pdfToMarkdown` preserves structure — headings, lists, tables — and falls back to vision OCR for scanned pages, which costs model tokens. Use it when layout matters or the PDF is a scan.

### Notes

- The operation, not the file name, decides how the bytes are parsed. Pointing `csv` at a spreadsheet fails the item.
- Tabular extraction multiplies your item count. Add a Limit or Filter node downstream before writing rows to an external system.
- `documentToMarkdown` reads the file name from the binary property to pick a converter, so upstream nodes should keep a correct extension on the file.