Skip to converter

DIF to CSV — what a forgotten export actually stores

A folder of .dif files from a system nobody maintains anymore. DIF predates the spreadsheet container: it is a text record format with a small header, and it stores bytes under a single-byte encoding rather than code points. Recovery is straightforward for the rows, and the encoding is where the honesty matters.

Cell formatting, colours, column widths and merged ranges are dropped; only stored values survive.

Drop files here or DIF, up to 12 MB
    Add a file to start.

    Processed on your device. Files aren’t sent anywhere.

    No sign-up. Nothing to install.

    What a DIF file stores

    The format describes a book of records with a header naming the data and text modules, then the records themselves.

    • A header declares the modules and the number of records.
    • Numeric fields and text fields are stored separately.
    • A field with no value is stored as an empty field.
    • There is no formatting layer, so nothing visual is lost.
    • There are no formulas, so nothing is left unevaluated.

    Reading records as rows

    Each record becomes a CSV row, in the order the file stored the fields.

    Stored in DIFIn the CSVNote
    Numeric field 12001200as stored
    Text field RigaRigaas stored
    Empty field(empty)column position preserved
    Accented namemay be replacedsingle-byte source

    Bytes, not code points

    Legacy files store bytes under a single-byte codepage. The reader decodes the file as UTF-8, so characters that were stored in another codepage can arrive changed or replaced. Accented names are the item to check against the original export, and there is no metadata in the file that tells the converter which codepage was used.

    Numbers and blank fields in the CSV output

    Values are written as text, because a delimited file has no types. Blank fields stay blank inside a row so columns keep their positions, while trailing blanks at the end of a row are trimmed. The output is UTF-8 with a byte order mark and CRLF line endings.

    A recovered row still needs a schema

    Suppose an old export has a customer code followed by a balance. After extraction, the destination still needs to know that the first field is an identifier and the second is an amount. Column order is part of that handoff. Compare a known record and an empty field before loading the CSV; a parser accepting the file is only the first check.

    Checking the recovered rows

    The header claims a record count, so use it as the check.

    1. Convert the .dif file and download the CSV.
    2. Open the CSV in a text editor.
    3. Count the rows and compare them with the records you expected.
    4. Check accented text against the original export.
    5. Convert numeric columns to numbers before importing.

    Questions

    Is DIF binary?
    No. It is a text record format with a header, which is why the reader can parse it without a spreadsheet application.
    Why did an accented name change?
    The file stores bytes under a single-byte codepage and the reader decodes as UTF-8. There is no codepage metadata in the file, so such characters can arrive replaced.
    Are numbers written as numbers?
    They are written as text, because CSV has no types. Convert the column in the spreadsheet after importing.
    How many rows can I recover?
    One file up to 12 MiB, and at most 20,000 rows are written. Records beyond that limit are left out rather than mixed into the import.

    Share this converter

    More sharing options