Also see flat file system, an entirely different term.
A flat file is a file containing records that have no structured interrelationship. The term is frequently used to describe a text document from which all word processing or other structure characters or markup have been removed.
In usage, there is some ambiguity about whether such markings as line breaks can be included in a "flat file." In any event, many users would call a Microsoft Word document that has been saved as "text only" a "flat file." The resulting file contains records (lines of text of a certain uniform length) but no information, for example, about what size to make a line that is a title or that a program could use to format the document with a table of contents.
Another form of flat file is one in which table data is gathered in lines of ASCII text with the value from each table cell separated by a comma and each row represented with a new line. This type of flat file is also known as a comma-separated values file (CSV) file.
In SQL for Dummies, an introduction to Structured Query Language, Allen G. Taylor notes that the advantage of a flat file is that it takes up less space than a structured file. However, it does require the application to have knowledge of how the data is organized within the file. By using SQL and a database (rather than a collection of files in a file system), a user or an application is free from having to understand the location and layout of data (for example, the length of each item of data, its type of data, and its relationship to other data items).
In relational databases, flat file is sometimes used as a synonym for a relation.