Flat file parser
Read a fixed width or delimited file as a table. Describe the fields once, and files with header, detail and trailer records are split by record type.
About this tool
Fixed width files have no separators: every field has a fixed position and length. Write one field per line in the definition, as name length when the fields follow each other, or name start length when you want to skip parts of the line. Start counts from 1. Lines that start with # are comments.
Many integration files mix record types, such as a header line, detail lines and a trailer. Write [H] on its own line to start the fields for lines that begin with H, then [D] for detail lines, and so on. The longest match wins, so [D1] beats [D]. Each record type gets its own table.
Lines that are shorter or longer than the definition are marked in yellow and explained in the status line. Letters such as æ, ø and å count as one position each. The position of the cursor in the file is shown under the file box, which helps when you write the definition.
Delimited files are read with the delimiter you choose, or the one that is detected. Values in quotes may contain the delimiter. If the file has no header, write the field names in the definition box, separated by commas or one per line.
Copy and Download give JSON, CSV, tab separated text for a spreadsheet, or Markdown. Print prints the tables only. Files are read in your browser and never uploaded.
Found a problem?
Tell us what went wrong. You decide whether your own work is included.
Licences
This tool is built with these third-party libraries:
- Papa Parse 5.7.0: MIT