Clean a list before importing it into a spreadsheet

Before importing, decide what one row represents and which columns must remain text. Here each row is a contact and the code is an identifier. If the spreadsheet interprets it as a number, 00123 can become 123. Keep a copy of the source file so you can start again.

Start with a small file

The sample uses semicolons as delimiters. The first name field contains a literal semicolon and is quoted. A plain split on semicolons would break the name across columns. Use an importer that understands quoted fields.

Stage CSV
Before
code;name
00123;"Anna; London"

00990; Émilie  
00990;Émilie
After
code;name
00123;"Anna; London"
00990;Émilie

3 records before cleaning, 2 after cleaning, 2 columns.

Clean the records in order

Check the UTF-8 encoding and use a preview that displays accented characters correctly. Identify the header and import with the chosen delimiter. Remove fully blank rows, then trim the edges of individual fields while keeping spaces inside names. A row with one empty field can still be a valid record. If a quoted field contains a line break, use the parser’s record count: the file can have more physical lines.

In this sample you can remove the exact duplicate after trimming. If the same code appears with different names, keep both records and review the source. Two rows with matching names and different codes may belong to different people.

Preserve zeros and long identifiers

In Excel, import with From Text/CSV and open the data transformation view. Set the code column to Text before loading and remove any earlier step that already converted it to a number. In Google Sheets, if the import dialog offers automatic conversion to numbers, dates and formulas, turn it off. Convert calculation columns afterwards as needed.

CSV quotes delimit fields, but the app can still infer their type. If zeros disappear, return to the source file and import again with the right type. Run the same check on long identifiers, which numeric conversion can round.

Check the result before saving

Check the column count, the record count, the name with the semicolon and the code with leading zeros. For repeated imports, record the delimiter, encoding and text columns alongside the file. If you hand someone a CSV, include those settings: their app may apply automatic conversions again on opening.

More articles