Home / Resources / Inspect a restaurant CSV before spreadsheet import

Restaurant data operations · Practical restaurant resource

Inspect a restaurant CSV before spreadsheet import

Separate physical lines from quoted logical records, investigate structural witnesses, and preserve raw field text before import.

UTF-8 bounded CSV syntax and structure, with explicit delimiter and header declaration.

Original constructed learning cases, prepared with software and AI assistance. Businesses, amounts and outcomes in the sample records are fictional. Sources support the named methods and scoped facts; they do not validate the sample values as industry benchmarks.

Work with your figures

Preflight your CSV structure

Declare a dialect, then inspect logical records, headers and exact text witnesses.

1 MB of UTF-8 text; at most 2,000 data records, plus one declared header; at most 50 columns. A quoted multiline field may span many physical lines. Syntax or limit failure suppresses the accepted record table.

Files are read locally in this tab. This tool does not upload your records or connect to a restaurant account. Reloading restores the fictional defaults. Keep sensitive records private.

A CSV can look tidy in a spreadsheet while containing a broken record boundary or a silently changed identifier. Inspect its raw structure first. Paste or select a local file below, declare the delimiter and header presence, and inspect the logical records before deciding how to import it. The tool reads data locally in this tab and performs no source lookup or automatic repair.

Declare the dialect before reading the result

CSV is text with field and record conventions; the extension alone does not identify its separator, encoding or business meaning. This inspector supports UTF-8 text, comma, semicolon or tab separators, and a declared optional header. It accepts CRLF, LF and CR line endings. Local file loading should reject invalid UTF-8; a pasted string has already been decoded, so the original byte encoding cannot be established from the paste.

  1. Keep the original file. Paste its raw contents or select it using the local file control.
  2. Choose the documented delimiter. Choose whether the first logical record is a header. A one-column result can be valid; it can also mean you chose the wrong separator.
  3. Run the diagnostic. If syntax is rejected, inspect the record, field and physical line witness and obtain a corrected source or verify your dialect choice.
  4. If syntax is accepted, review field counts, header issues and text-preservation witnesses before importing.
  5. Use the parsed-record table to compare values with the source specification. Save the current JSON result if you need to preserve the chosen configuration and observations.
From file structure to an import decision
  1. Declared UTF-8 text and delimiter → parse quote boundaries.
  2. Quote-state error → stop; do not accept a reconstructed table.
  3. Complete records → count fields and inspect declared headers.
  4. Consistent structure → review text-sensitive values and source population separately.
  5. Choose explicit spreadsheet column types, then test the saved result.

Quoted commas, line breaks within a quoted field, and doubled quotes are common CSV conventions described in RFC 4180. That document is informational. This tool's explicit dialect adds semicolon/tab choices; passing its parser is a statement about these configured rules, not universal compatibility.

Two data records can occupy four physical lines

Download the fictional multiline CSV. It contains this text; the two displayed lines inside the final quoted note belong to one field:

id,note
001,"hot, mild"
002,"line one
line two"

With comma delimiter and header “Yes”, the answer is 3 logical records, 2 data records, 4 physical lines and 2 expected columns. The first ID is the exact string 001. The comma in hot, mild does not create a third field. The second note contains a CRLF between its words. Splitting only at newline characters would invent a fourth logical record and lose the actual row boundary.

The count relationship is data records = logical records − 1 when a header is declared, and data records = logical records otherwise. Physical lines count line endings wherever they occur, including inside quotes. CRLF counts once; a final record ending does not add a blank physical line. An intentional blank record between two other records remains a one-field record and can therefore be ragged.

Eight small files isolate eight questions

All fixtures below are original fictional text. Their expected-answer JSON and README text explain exact settings and answers.

Downloadable CSV challenges; comma delimiter and header present
FixtureExpected observationNext action
Quoted comma CSVOne data record; two fields; note is hot, mild.Keep the delimiter inside the quoted note.
Embedded newline CSVTwo data records occupy four physical lines.Count logical records using quote boundaries.
Escaped quote CSVThe note becomes say "hello".Read doubled quotes as one field character.
Unclosed quote CSVReject field 2 of record 2; its quote starts on physical line 2.Verify the original export; do not append a guessed quote.
Ragged record CSVRecord 2 has three fields; the declared header has two.Inspect a stray separator or a schema mismatch.
Duplicate header CSVBoth physical columns remain; the second id header is flagged.Obtain unique documented column names before mapping by name.
BOM CSVA leading byte-order marker is reported and removed from the first header only.Distinguish the marker from a character in an identifier.
Leading-zero CSV00123 and the 18-digit ID remain exact text; zero amount stays present.Declare text types before spreadsheet import.

Syntax acceptance still leaves decisions to make

A field-count warning means the parser found complete records whose widths differ. The tool does not move an extra field into the preceding note or fill a missing field. A duplicate header is a mapping ambiguity, not evidence that either column should be deleted. Blank headers are flagged without assigning invented names. Header-only files have zero data records; an empty input is rejected. A zero string is a present value and is never treated as a blank.

Text witnesses flag selected patterns: leading-zero numeric text, numeric strings of 16 or more digits, formula-like prefixes and replacement characters. These are review prompts. The prefix check can also flag an ordinary negative number and does not detect every spreadsheet formula mechanism. The diagnostic does not execute cells or establish that a file is safe to open in another application.

Microsoft documents importing designated Excel columns as Text and the limits of numeric precision. Those choices depend on the Excel edition and workflow. See the official text-import guidance. Use the identifier round-trip test to compare a saved file against an untouched baseline.

Inputs are capped at 1 MB, 2,000 data records and 50 columns. Syntax or size failure suppresses an accepted record table. For accepted inputs, counts cover all supported records even when only the first 100 table rows are initially visible. The JSON download records the current inputs and result; it is not a repaired CSV download.

Keep structural and business acceptance separate

A well-formed file may still omit a day, repeat an order, mix currencies or contain an invalid date. This tool does not infer a locale, trim fields, deduplicate records or certify source completeness. Continue with vendor export acceptance tests to check a documented source population, and the export-cleaning guide for a traceable transformation plan. To explain differences between two comparable files, use the export diff inspector.

Sources, method and boundaries

Check any local rule, contract and source definition before applying this method. These exercises are not a professional legal, tax, food-safety or accounting determination. Read our editorial process or report a factual or calculation problem.

Continue with the right evidence