Re: Flat-File Vs. Text-File

From: David Cressey <david_at_dcressey.com>
Date: Mon, 29 Jan 2001 15:37:57 GMT
Message-ID: <p7gd6.34965$2X4.85046_at_petpeeve.ziplink.net>


"Tom Leary" <tleary1_at_qwest.net> wrote in message news:t4%c6.1564$D_.332748_at_news.uswest.net...
> Generally, a Flat File contains data in a consistent format that can
 easily
> be parsed out. A Text File has no such constraints and could be anything
> from the Flat File type data to a Novel. They are not exclusive, all Flat
> Files are Text Files, but not all Text Files can be parsed by data
> structure.
>
> HTH,
>
> Tom
>
> "Lee Shelton" <lee_shelton_at_my-deja.com> wrote in message
> news:94t0d4$l7c$1_at_nnrp1.deja.com...
> > I've been hearing the term "flat-file" used a lot here, where I work,
> > and I think the term is being mis-used.
> >
> > They way it's used here is to mean what I simply call a "text-file" --
> > just some ASCII output from a report, or even a dump of a table's
> > contents.
> >
> > For example, folks here would say that this is a "flat-file":
> > -->
> > 1101 "Adams, Allen" "123 Anystreet" "Ourtown" "AR"
> > 2202 "Baker, Bill" "224 Park Ave" "Anycity" "CA"
> > <--
> >
> > When, really (in my thinking), this is a text-file "dump" of the
> > Customer Table (Customer Number, Name, City, State).
> >
> > I thought that a flat-file contained database structure info and may
> > certainly be a text-file, but not all text-files are flat-files.
> >
> > I cannot find any good glossaries to straighten us (or probably "me")
> > out.
> >
> > Anyone here care to offer a definition?
> >
> > Thanks,
> > Lee
> >
> >
> > Sent via Deja.com
> > http://www.deja.com/
>
>

Here's my opinion: not all text files are flat files, and not all flat files are text files.
I'm going to call a file "flat" if it consists of "records", and all the records are of the same "record type".
This lines up well with the definition that says it must represent only one table. All the rows of a table
have the same columns, by definition. If the data in a table is copied to a file, one record to a row, the file is, by definition, "flat".

Ascii delimited text is a way of representing records in text. It's possible to store, in Ascii delimited text, records of multiple types in one file. Example: order headers and order details in the same file. In my parlance, such a file would not be "flat". And, of course, a document stored in a text file would not be flat, as others have commented.

In my parlance, a file could be flat, even if one or more of the fields in each record contained binary data. The usefulness of such a file could be rather limited, if you are migrating data across platforms. But as to whether it's "flat"or not, well, it can be, if it meets the definition stated above.

I recognize that there are a lot of people who use the term "flat file" in ways that conflict with this way. It's the Babel syndrome, again. Received on Mon Jan 29 2001 - 16:37:57 CET

Original text of this message