Skip to content

Learning AI · Practical guide

Check a sample before importing the whole file.

This exercise organises the review of a request table. It does not modify files for you; it helps define import rules and expected results before using a tool on real data.

By Eric Muriel2 min read
Bar and line charts displayed on a laptop.
Illustrative data analysis photograph; it does not show results from this exercise.Photo: Antoni Shkraba · Pexels · Pexels License

The process at a glance

  1. Original

    Keep an unchanged copy

  2. Review

    Separate valid rows, duplicates and conflicts

  3. Import

    Compare the outcome with the sample

Original diagram of this guide’s exercise.

01Prepare four rows that reveal problems

Create fictional columns id, name and quantity. Use A01/Ana/2, A02/Luis/empty, A01/Ana/2 and A03/Marta/two. The sample contains a complete row, a missing value, a repetition and a quantity written as text.

Keep the original. Before correcting anything, decide whether “two” is allowed or needs review and whether an empty quantity means unknown. Converting it to zero without agreement changes its meaning.

02Write rules for each column

For this exercise, id is required unique text, name is required text and quantity must be a positive integer. These are exercise decisions, not universal rules for every CSV.

Define how to detect repeated rows and what happens when the same id carries different values. An identical repetition and conflicting information require different decisions.

03Check how the file is read

RFC 4180 documents a CSV convention using commas and quoted fields. Check your tools’ actual export and import settings rather than assuming every tool uses the same configuration.

Add a name containing a comma and another with an accented character. Verify that the name stays in one column and characters survive. Also check that identifiers such as 001 retain leading zeros.

Reference [1]: RFC Editor · RFC 4180

04Compare the result before expanding

Under the proposed rules, A01 is accepted once, A02 awaits a missing quantity and A03 requires explicit correction. Keep a reason for each rejected row so someone can resolve it.

Import the sample into a test destination first. Compare row counts, identifiers and values with expectations. Expand only after explaining each difference, retaining a way to identify records belonging to this import.

Sources and further reading

These references expand on the concepts indicated. The examples and exercises are original editorial material.

  1. [1] RFC Editor · RFC 4180

    Common Format and MIME Type for CSV Files ↗

    Section 2: fields, separators and quoting.

    Back to the related section
How we use sources, quotes and images

Frequently asked questions

Should I delete rows that fail review?

This exercise sets them aside with a reason and preserves the original. You can correct or exclude them without losing the input information.