# Validate a Vendor CSV Before Loading It Into Your Warehouse

> Stop bad files at the door: validate an incoming CSV, Excel, JSON or Parquet file against a data contract before loading it. See the exact pass/fail output.

Page: https://datautility.in/blog/validate-vendor-csv-before-loading-warehouse
This is the Markdown copy of the page. The tool itself runs in the browser: your files are processed on your own device and are not uploaded.

Published 2026-11-20 · Analyze & protect · validate csv before loading, validate incoming file, csv schema validation, vendor file validation, data validation before load, check csv against schema, data quality gate, file validation tool

A vendor sends a file every week. Most weeks it is fine. Some weeks a column is missing, a date changes format or a new status value appears, and nobody notices until a report is wrong. A data contract turns what you expect into a check that runs before the file touches your warehouse. This guide shows the routine, with the exact results from a real run.

Open the tool: [Data Contract Generator](https://datautility.in/data-contract-generator)

## The idea: check at the door

Loading a bad file is cheap. Finding out three days later, after it fed a dashboard, is not. Put one check between receiving a file and loading it. If the check fails, the file waits and someone asks the vendor.

## Step 1: write the contract once

Take a file you know is good and load it in the [Data Contract tool](https://datautility.in/data-contract-generator). It profiles the file and suggests rules. Keep the safe ones (types, required, minimum rows, no duplicate rows, a unique key), and add allowed values only for a fixed list such as `status`. Download the contract as ODCS YAML. The [rules guide](https://datautility.in/blog/data-contract-rules-explained-required-unique-allowed-range) explains which to trust.

## Step 2: validate each new file

In the Validate tab, drop the new file and the contract. The tool reads CSV, Excel, JSON, Parquet or Avro, so the vendor can change format without breaking the check. Here is the result for a sample delivery that has several problems. The rows are counted from 1 under the header.

```
8 of 20 rules failed

fail  The file has no columns that are not in the contract      (extra column: coupon)
fail  order_id must have no duplicate values                    row 2: 2001
fail  customer_email must never be empty                        row 2: (empty)
fail  status must be one of: paid, pending, refunded            row 2: shipped
fail  amount must be between 10 and 92.5                        row 2: -5
fail  order_date must be a date                                 row 2: 04/02/2026
fail  order_id must be between 1001 and 1012                    rows 1, 2, 3 (see the warning below)
fail  order_date must be between 2026-03-01 and 2026-03-12      rows 1, 3 (see the warning below)

pass  Every column in the contract is in the file
pass  The table must have at least 1 row
pass  order_id must be an integer
...
```

Read it from the top. An extra column `coupon` is a schema change. Row 2 has a duplicate ID, an empty email, a status nobody agreed to, a negative amount and a date in another format. Those are real problems to send back to the vendor.

The last two failures are different. The range rules on `order_id` and `order_date` came from the sample, so they reject every file after the sample period. That is a bad rule, not a bad file. Switch those two off, and the contract is honest.

## Step 3: decide what happens on a failure

- **Block:** a failed required, type or unique rule usually means the file should not load.

- **Warn:** a new allowed value might be legitimate. Check with the vendor, then add it to the list.

- **Download the report:** the tool saves the result as an HTML or CSV report, with or without example rows, to send to the vendor.

## Step 4: keep the contract alive

When the vendor tells you about a change, update the contract and its version, then validate again. A contract that nobody updates will start failing good files and people will stop reading it.

## Compare with last week's file

A contract catches rule breaks. It does not show what changed. For that, compare this week's file with last week's by key with [Data Comparison](https://datautility.in/data-comparison): which rows were added, removed or changed. Together the two checks cover most surprises.

## What this does not do

- It runs when you open it. It does not watch a folder or run on a schedule. For automatic checks, run the same rules in your pipeline, for example as dbt tests.

- It checks one file at a time and cannot check it against another table.

- Very large files depend on your browser's memory.

## How to use the Data Contract Generator: step by step

1. Generate a contract from a known-good file.
2. Switch off rules built from one sample.
3. Validate each new file.
4. Block, ask the vendor, or update the contract.

## When to use the Data Contract Generator

- Checking a weekly vendor or partner file
- Catching a schema change before the load
- Sending the vendor a list of exact failures

## Example

Input:

```
orders.csv: order_id, status, unit_price
```

Output:

```
kind: DataContract
schema:
  - name: orders
    properties:
      - name: order_id
        logicalType: integer
        required: true
        unique: true
```

## Frequently asked questions

### How do I validate a CSV file before loading it?
Write a data contract from a known-good file, then drop each new file and the contract in the Validate tab. It lists each rule as pass or fail, with the rows that break it.

### Which file formats can I validate?
CSV, Excel, JSON, Parquet and Avro.

### Does it catch a new column or a missing column?
Yes. A column in the contract that is missing from the file fails, and by default so does a column in the file that is not in the contract.

### Can it run automatically?
No. It is a tool you open. To run the same rules on every load, put them in your pipeline, for example as dbt tests.

### Is the file uploaded?
No. The file is checked in your browser and is not uploaded to our servers.

Tip: Test a new contract on last month's good file first. If it fails, fix the contract before it fails a real delivery.

## Related tool pages

- [ODCS Data Contract Generator](https://datautility.in/odcs-data-contract-generator): Generate an Open Data Contract Standard (ODCS) v3 YAML file from a CSV, Excel, JSON or Parquet file. Edit the rules, then download. Free, in your browser.
- [Validate a CSV Against a Schema](https://datautility.in/validate-csv-against-schema): Check a CSV or Excel file against a data contract: required values, types, unique columns, allowed values, ranges, patterns and missing or extra columns. Free, in your browser.

## Also try

- [Data contract rules explained](https://datautility.in/blog/data-contract-rules-explained-required-unique-allowed-range)
- [Compare files in different formats](https://datautility.in/blog/compare-two-files-different-formats-csv-json-parquet-excel-avro)
- [Validate a CSV against a schema](https://datautility.in/validate-csv-against-schema)

## More guides

- [Data Profiler: Check Data Quality Before You Use It](https://datautility.in/blog/data-profiler-check-data-quality)
- [Compare Two CSV or Excel Files: Find Added, Removed and Changed Rows](https://datautility.in/blog/compare-two-csv-files-find-differences)
- [Data Masking: Hide Emails, Phones and Names Before Sharing](https://datautility.in/blog/data-masking-hide-emails-phones-pii)
