Text to CSV Converter: Turn Text, Tables & Logs into CSV avatar

Text to CSV Converter: Turn Text, Tables & Logs into CSV

Pricing

from $0.06 / 1,000 row converteds

Go to Apify Store
Text to CSV Converter: Turn Text, Tables & Logs into CSV

Text to CSV Converter: Turn Text, Tables & Logs into CSV

Text to CSV converter: turn pasted text, text file URLs or a dataset field into CSV, Excel (XLSX) and JSON rows. Detects comma, tab, pipe, space and fixed-width columns, and parses regex matches, key-value blocks, Markdown, ASCII and HTML tables, and Apache, nginx and syslog logs.

Pricing

from $0.06 / 1,000 row converteds

Rating

0.0

(0)

Developer

Data Done Right

Data Done Right

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

24 days ago

Last modified

Features

Limited permissions

Share

Text to CSV converter that turns pasted text, text file links or a dataset field into clean CSV, Excel (XLSX) and JSON. It detects the delimiter (comma, tab, semicolon, pipe, runs of spaces or fixed-width columns), and it can also parse regex matches, key: value blocks, Markdown, ASCII and HTML tables, and Apache, nginx and syslog logs into columns. No API key, no code, nothing to install.

What you get:

  • One dataset row per table row, with one key per column and numbers, true/false and dates typed.
  • Optional CSV, XLSX and JSON files with download links (the CSV opens correctly in Excel, UTF-8 with BOM by default).
  • A SUMMARY record with rows, columns, the detected mode and delimiter, and warnings such as ragged rows.

How to convert text to CSV

  1. Paste your text in Text to convert (or add Text file URLs, or pick a Dataset with text and name the field).
  2. Leave Mode on Auto-detect. The Actor recognizes HTML and text tables, logs, key: value blocks and delimited columns.
  3. Under Output files keep csv, add xlsx or json if you want them, and run it.
  4. Read the rows from the run's dataset, and the file links from the SUMMARY record (perSource[].files[].url) or the key-value store.

Input (this is the prefill, a pipe-delimited block):

{
"text": "id|name|city|amount|joined|active\n1|Ada Lovelace|London|1250.50|2024-01-15|true\n2|Grace Hopper|New York|980|2024-02-03|true\n3|Alan Turing|Manchester|15.25|2024-02-19|false\n4|Katherine Johnson|Hampton|2100|2024-03-08|true\n5|Linus Torvalds|Portland|75.5|2024-03-30|true\n",
"outputFormats": ["csv", "xlsx", "json"]
}

Output, first dataset row (from a real run):

{
"id": 1,
"name": "Ada Lovelace",
"city": "London",
"amount": 1250.5,
"joined": "2024-01-15",
"active": true
}

SUMMARY record (shortened, from the same run):

{
"sources": 1, "sourcesConverted": 1, "sourcesFailed": 0, "rows": 5, "filesExported": 3,
"stoppedBySpendingLimit": false,
"perSource": [{
"source": "pasted-text", "status": "ok", "mode": "delimited", "delimiter": "pipe", "headerRow": true,
"columns": ["id", "name", "city", "amount", "joined", "active"],
"columnTypes": {"id": "int", "name": "text", "city": "text", "amount": "number", "joined": "date", "active": "bool"},
"rowsParsed": 5, "rowsDelivered": 5, "warnings": [],
"files": [{"format": "csv", "key": "converted.csv", "url": "https://api.apify.com/v2/key-value-stores/.../records/converted.csv", "bytes": 277}]
}]
}

The CSV file keeps your original text (1250.50 stays 1250.50); the dataset, JSON and XLSX use the typed values (1250.5).

How to parse text into columns

Pick a mode, or let Auto-detect choose:

ModeUse it forNotes
delimitedCSV, TSV, ; or `` separated data, columns separated by 2+ spaces, fixed-width reports
linesPlain listsOne row per line (column line), one column per line (line_1, line_2...), or split each line on a separator such as -.
regexAnything with a patternNamed groups become columns: (?P<ip>\d+\.\d+\.\d+\.\d+) (?P<status>\d{3}). Per line, or find all matches across the text.
keyvalueContact cards, config dumps, command outputkey: value or key=value. Records are separated by blank lines, or start again when a key repeats. Indented lines continue the previous value.
tableTables pasted from docs or terminalsMarkdown, ASCII (+---+), box-drawing (┌─┬─┐) and simple HTML <table>. Pick which table with Table number.
logServer and app logsApache/nginx access log (common and combined), nginx error log, syslog (RFC 3164 and 5424), and 2024-01-15 10:30:00 INFO ... application logs.

How to convert text to Excel

Add xlsx to Output files. The workbook has one sheet named Data, a frozen header row, real numbers, real true/false cells and real Excel dates (for columns where every value is a date). Text is always stored as text, so a value like =SUM(A1) is never run as a formula.

How to turn log lines into a table

Paste access log lines with Mode on log (or Auto-detect). An Apache line becomes a row with ip, user, timestamp (ISO 8601 with the time zone), method, path, protocol, status, bytes, referer and user_agent. A dash in the log becomes an empty value. Lines that do not match are skipped and counted in the warnings. For any other log layout use regex mode with named groups.

Input

FieldDefaultWhat it does
textprefillPasted text.
fileUrlsemptyLinks to text files (.txt, .log, .csv, .tsv, .md, .html). Up to 500.
datasetId / datasetFieldemptyAn Apify dataset and the field with the text (dots reach nested fields). Each item is its own table.
modeautoauto, delimited, lines, regex, keyvalue, table, log.
delimiterautoauto, comma, tab, semicolon, pipe, spaces, fixed, custom.
customDelimiteremptyYour separator (several characters allowed; \t means tab).
quoteHandlingautoauto (double quotes), double, single, none.
regexPatternemptyPython regex; named groups become columns. Setting it with Mode on auto switches to regex mode.
regexScopeperLineperLine or findall.
regexIgnoreCasefalseCase-insensitive pattern.
lineSeparatoremptyLines mode: split each line on this text.
linesLayoutrowsLines mode: rows or columns.
logFormatautoauto, apache, nginx, syslog, timestamped.
keyValueSeparatorautoauto, colon, equals.
tableNumber1Which table to convert when there are several.
headerRowautoauto, yes, no (no creates column_1, column_2...).
skipLines0Lines to ignore at the start.
trimtrueStrip spaces from values and names; empty cells become null.
skipBlankLinestrueDrop blank lines and all-empty rows.
inferTypestrueNumbers and booleans (and the master switch for dates).
inferBooleanstrueOnly true and false count.
inferDatestrueNormalize clear dates to ISO 8601.
maxRows100000Rows per source (1 to 500,000). Caps dataset rows and cost.
encodingautoFor files from links: auto, utf-8, utf-16, cp1252, latin-1.
includeSourcefalseAdd _source to every dataset row (always on with more than one source).
maxFileSizeMb50Larger sources are skipped for free.
outputFormats["csv"]Any of csv, xlsx, json; empty for dataset only.
outputEncodingutf-8-sigCSV encoding: UTF-8 with BOM, UTF-8, or Windows-1252.
outputDelimitercommaCSV separator: comma, semicolon, tab, pipe.
quoteAllFieldsfalseQuote every CSV value.
escapeFormulastruePrefix =, +, -, @ text with an apostrophe in the CSV.

Type detection

A column is converted only when every non-empty value in it fits, so a column never ends up half numbers and half text.

  • Numbers: 42, -3.5, 1e5. 007, +15551234567 and integers of more than 15 digits stay text (IDs and phone numbers).
  • Booleans: true and false in any case. Not yes/no, 1/0.
  • Dates: 2024-01-15, 2024-01-15 10:30:00, 2024/01/15, 15 Jan 2024, Jan 15, 2024 become ISO 8601. A numeric date such as 03/04/2024 is converted only if another value in the column shows which part is the day (13/04/2024); otherwise it stays text and a warning says so.

How much does it cost

Pay per event: $0.00008 per row delivered (row-converted, $0.08 per 1,000 rows) and $0.003 per output file (file-exported; a CSV, an XLSX and a JSON file are three files). Blocked, unreadable or empty sources are free.

  • 1,000 rows to CSV: $0.08 + $0.003 = $0.083.
  • 10,000 rows to CSV and XLSX: $0.80 + $0.006 = $0.806.
  • 100,000 rows to CSV: $8.00 + $0.003 = $8.003. The same 100,000 rows to the dataset only: $8.00.

Paid Apify plans get a platform discount. Max rows per table and Output files cap what a run can cost; if you set a maximum spend per run, the Actor stops cleanly, keeps the rows already delivered and writes files from them.

Use cases

  1. Convert a pasted report, e-mail table or terminal output into a spreadsheet.
  2. Turn Apache, nginx or syslog lines into a table for analysis in Excel or a BI tool.
  3. Turn key: value exports (contacts, inventories, ipconfig-style output) into one row per record.
  4. Convert Markdown or ASCII tables from documentation, chats and READMEs to CSV or XLSX.
  5. Post-process a scraper: read the text field of another Actor's dataset and split it into columns with a regex.

FAQ

How do I convert text to CSV without code?

Paste the text into Text to convert, keep csv in Output files, run. The file link is in SUMMARY, and the same rows are in the dataset, which you can also download as CSV, Excel or JSON from the Apify console.

Why does my CSV keep 1250.50 but the dataset shows 1250.5?

The CSV file is written from your original text, so nothing is rewritten silently. The dataset, the JSON file and the XLSX use typed values. Turn off Detect numbers and booleans to get text everywhere.

What happens with ragged rows?

Short rows are padded with empty cells and longer rows get extra columns (column_4...). The count and the first row number appear in the warnings. A different delimiter or Quote handling often fixes it.

Can it parse any log format?

Apache/nginx access logs, nginx error logs, syslog and timestamped application logs are built in. Everything else needs regex mode with named groups. Unmatched lines are skipped and counted, not guessed.

What does it not do?

It does not read PDFs, images or Word files (use a document converter first), does not follow wrapped multi-line table cells (each line becomes its own row), does not interpret merged HTML cells (colspan/rowspan), and does not guess a date order when it cannot tell. Regex runs on your text with Python's engine; a pattern with catastrophic backtracking can run until the run's time limit.

What are the limits?

50 MB per source by default (up to 500 MB), 500 sources per run, 100,000 rows per source by default (up to 500,000), 16,384 columns, and about 1,048,575 rows for the XLSX file (use CSV for more). Links to localhost, internal names and private networks are blocked.

Use with the Apify API, MCP, n8n or Make

Python:

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/text-to-csv-converter").call(run_input={
"text": "name|qty\napple|3\npear|5",
"outputFormats": ["csv"],
})
rows = client.dataset(run["defaultDatasetId"]).list_items().items
summary = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("SUMMARY")["value"]
print(rows, summary["perSource"][0]["files"][0]["url"])

JavaScript:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/text-to-csv-converter').call({
text: 'name|qty\napple|3\npear|5',
outputFormats: ['csv'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

In n8n or Make, use the Apify node or module "Run Actor", pass text and the options as JSON, then read the dataset items. For AI agents (MCP), the Actor needs one field: text.

  • Excel to JSON Converter: XLSX, XLS & CSV to JSON API: read spreadsheets and CSV files into JSON rows.
  • Merge Datasets & Dedupe: Combine, Filter, Export CSV & Excel: combine the converted rows with other data and remove duplicates.
  • Email Extractor from Text: Emails, Phones & URLs from Any Text: pull contact details out of the same text.