# Excel & CSV Data Cleaner (`verifiedsheets/excel-csv-data-cleaner`) Actor

Clean messy Excel and CSV files from a plain-English request: remove duplicates, fix dates and number formats, tidy text, add calculated columns. Every result is checked by code before delivery: you pay USD 1.00 only for verified files. Failed or unsupported files are free.

- **URL**: https://apify.com/verifiedsheets/excel-csv-data-cleaner.md
- **Developed by:** [Verified Sheets](https://apify.com/verifiedsheets) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / verified file

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Excel & CSV Data Cleaner

**Try it free: click Start without uploading a file to run a free demo on sample data.**

Request: *"Remove duplicates by email, convert the dates to YYYY-MM-DD, remove extra spaces
and capitalize names and cities."*

| Before | After |
|---|---|
| `" ana  LOPEZ "`, seattle, 19/04/2025 | Ana Lopez, Seattle, 2025-04-19 |
| Ben Carter, `"AUSTIN "`, 2025-01-28 | Ben Carter, Austin, 2025-01-28 |
| chloe diaz, Denver, 13/10/2025 | Chloe Diaz, Denver, 2025-10-13 |
| Chloe Diaz, denver, 2025-10-13 (same email) | *removed: duplicate* |
| Daniel Kim, CHICAGO, 26/07/2025 | Daniel Kim, Chicago, 2025-07-26 |

Clean Excel data and CSV files: remove duplicates, fix date formats, convert numbers
stored as text and standardize data. Upload one Excel (`.xlsx`) or CSV file and say in
plain words what you want fixed. You get back the cleaned file, a short note on what was
done, and the detail of every automatic check run on the result.

**You pay USD 1.00 per verified file.** If the result is not verified, the file is
rejected, or the run fails, you are not charged.

### What this Excel data cleaner does

The Actor applies a fixed set of operations. Each one is ordinary code, written
and tested in advance, and nothing is improvised for your file:

- **Remove duplicates:** removes rows that repeat on the columns you name, and keeps the first one.
- **Fix date formats:** converts a date column to `YYYY-MM-DD`. Dates that can be read two ways
  (`03/04/2025`) or that do not exist (`31/02/2025`) are left as written and flagged
  in a separate column.
- **Numbers stored as text:** turns them into real numbers and works out whether the
  decimal separator is a comma or a dot.
- **Values that look wrong:** flags numbers in a column that cannot be read, are
  negative, are zero, or are far from the rest.
- **Standardize data:** removes extra and invisible spaces. Words are capitalized
  only if you ask for it.
- **Headers:** finds the real header row when there is a title above it, and renames
  headers (for example, from two languages to one).
- **A calculated column:** the product, sum or difference of two columns.
- **One sheet per value:** splits the table into sheets by the values of one column
  (Excel output only).

When a CSV is delivered as `.xlsx`, columns that only hold plain numbers (such as
`2444` or `212.51`) become real numbers, so Excel can add them up. Codes with leading
zeros, like `007`, stay as text.

#### Requests that work

> Please remove duplicate rows based on the email column and standardize the name and
> city columns (proper case, no extra spaces).

> This file has dates in different formats. Convert everything to YYYY-MM-DD and flag
> anything you cannot resolve.

> The amount column is stored as text. Convert it to numbers and tell me if any value
> looks wrong.

> Normalize the headers to English, fix the decimal separator and calculate the total
> amount column. Deliver as xlsx.

> Clean up this shipment report and split it into three sheets by port. Keep all the
> columns.

Name the columns and say exactly what should change. A generic "clean up" only removes
extra and invisible spaces. The note tells you what was left as it came, so you can run
the Actor again and ask for it.

### Try it without a file

Run the Actor with no file and it cleans a small sample file (`sample_customers.csv`,
made-up data) with the example request. The demo is free: you get the normal output and
are not charged. To clean your own data, upload your file.

### Files for the CSV cleaner

- One file per run: `.xlsx` or `.csv`, up to 20 MB, with one table.
- The format is detected from the file's content. A CSV can be comma, semicolon or tab
  separated, in UTF-8 or Windows (cp1252) encoding.

### How it is verified

After the cleaning, automatic checks written in code run on the output file. They
cover, for example:

- the file opens;
- no column or row disappeared without a reason;
- every date in a converted column is `YYYY-MM-DD` or flagged;
- every converted number matches the original;
- columns you did not ask to change are identical to the input.

You are charged only if every check passes.

An AI review also compares the result with your request. If it finds something you
asked for that no operation covered, the file is not charged. It can never make a file
pass a check.

### What you get

| Output | What it is |
|---|---|
| The cleaned file | `<your file name>_cleaned.xlsx` (or `.csv`), in the run's key-value store, linked from the dataset row and the Output tab |
| `NOTE.txt` | What was done, how each part of the request was read, and what was left as it came |
| `VERIFICATION.json` | Every check run on the result, with its outcome |
| `WARNINGS.txt` | Only when the result did not pass verification: what did not pass |

Each run adds one row to the dataset with `status` (`verified`, `not verified`,
`not supported`, `blocked`, `invalid input`, `max charge too low` or `free plan limit`),
`charged`, and links to the `file`, `note`, `verification` and `warnings`.

If the result could not be verified, the file is still delivered as
`NOT_VERIFIED_<your file name>.xlsx`, `WARNINGS.txt` says why, and you are not charged.

### Pricing

- **USD 1.00 per verified file**, charged once per run.
- No charge when the result is not verified, the request is outside what the Actor
  does, the file is not a readable `.xlsx` or `.csv`, or the run fails.
- **Set the maximum cost per run to USD 1.00 or more.** With a lower limit, the run
  stops before doing any work and nothing is charged.
- **Apify Free plan:** up to 3 verified files per month. After that, the run stops
  before processing, nothing is charged, and the note explains that a paid Apify plan
  is needed to continue.

### What it does not do

- PDF, Word, images, old `.xls` files or more than one file per run.
- Requests outside the operations above (for example, summaries, pivot tables, charts
  or merging files). You get a note saying so, your file is not changed, and you are
  not charged.

### Privacy

- Your file is processed in a temporary container that is deleted when the run ends.
  The input and the cleaned file stay only in your own run storage.
- To read your request and review the result, the column names and a sample of up to
  10 rows are sent to Anthropic's Claude API. Before sending, emails, phone numbers,
  IBANs, card numbers, tax IDs and IP addresses are replaced with placeholders. Names
  are not.
- We do not keep your file or its values. We keep only anonymous metrics:
  - the shape of the table (column types and patterns) and the plan that worked, with
    column names stored as salted hashes;
  - for requests the Actor could not handle, a short description with the column names
    hashed;
  - for rejected files, only the file type and the date;
  - run results and costs.

# Actor input Schema

## `archivo` (type: `string`):

One Excel (.xlsx) or CSV file with one table, up to 20 MB. PDF, Word, images and old .xls files are not accepted. Leave it empty to run a free demo on a small sample file.

## `pedido` (type: `string`):

Say in plain words how to clean Excel data or a CSV, and name the columns. For example: remove duplicates based on the email column; fix date formats (convert the dates to YYYY-MM-DD); convert the amount column to numbers and flag values that look wrong; standardize data (proper case, no extra spaces); rename the headers to English; calculate a total column; split into one sheet per country. A generic "clean up" only removes extra spaces. Excel data cleaner and CSV cleaner pricing: set the maximum cost per run to USD 1.00 or more; you pay USD 1.00 only if the file is verified.

## Actor input object example

```json
{
  "pedido": "Remove duplicate rows based on the email column and convert the dates to YYYY-MM-DD."
}
```

# Actor output Schema

## `results` (type: `string`):

One row per run: status, whether it was charged, and links to the cleaned file, the note and the verification report.

## `note` (type: `string`):

What was done, how each part of the request was read, and what was left as it came.

## `verification` (type: `string`):

Every automatic check run on the cleaned file, with its outcome.

## `files` (type: `string`):

Every file of the run: the cleaned file, the note, the verification report and, if any, the warnings.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pedido": "Remove duplicate rows based on the email column and convert the dates to YYYY-MM-DD."
};

// Run the Actor and wait for it to finish
const run = await client.actor("verifiedsheets/excel-csv-data-cleaner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pedido": "Remove duplicate rows based on the email column and convert the dates to YYYY-MM-DD." }

# Run the Actor and wait for it to finish
run = client.actor("verifiedsheets/excel-csv-data-cleaner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pedido": "Remove duplicate rows based on the email column and convert the dates to YYYY-MM-DD."
}' |
apify call verifiedsheets/excel-csv-data-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,verifiedsheets/excel-csv-data-cleaner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/P5a2RbyDMS7u31Yht/builds/gAe0LbkAvt33NdG71/openapi.json
