Flat-File Databases

A flat-file database is simply a plain text file that stores multiple records separated by delimiters. A delimiter is a character, or group of characters, that indicates where one record (or field) ends and another begins. Flat-file databases ordinarily use one delimiter to indicate the breaks between records, and a different delimiter to indicate the breaks between the fields that make up a record. Alternatively, if you know what size each field is going to be, you can split the data up by assigning a width to each field.

If you know, for example, that the colon (:) character isn’t going to appear within the data in your file, you could use the colon to separate the fields in each record. Another popular method of delimiting ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.