tags:

views:

87

answers:

5

I've been using this file-format below as an alternative for flat-text files, and I'm wondering if there is a name for it...

Say you have this data in a CSV:

FirstName,LastName,Email,UserName,Notes
Bob,Smith,[email protected],bsmith,Bob likes chicken
John,Doe,[email protected],jdoe,
Steve,Jobs,[email protected],STEVE,Steve Jobs likes things that start with "i"

In this "other" file format, there are 3 columns:

  1. Unique ID
  2. Attribute Name
  3. Value

The above data would look like this:

[email protected],FirstName,Bob
[email protected],LastName,Smith
[email protected],Email,[email protected]
[email protected],UserName,bsmith
[email protected],Notes,Bob likes chicken
[email protected],FirstNameJohn
[email protected],LastName,Doe
[email protected],Email,[email protected]
[email protected],UserName,jdoe
[email protected],FirstName,Steve
[email protected],LastName,Jobs
[email protected],Email,[email protected]
[email protected],UserName,STEVE
[email protected],Notes,Steve Jobs likes things that start with "i"

I actually delimit on tab, but comma is easier to read for this. And in this example, any of the attributes could be used as a unique identifier.

+5  A: 

It's still CSV. You're just presenting the data from a different aspect, in terms of its structure, not its content.

siride
Understandable... I'm wondering if there is a name though. It is CSV (or tab delimited), but it's not "flat-text"... is it something else?
jcoon
It's Entity Attribute Value
jcoon
A: 

If you delimit on tab then it's a tab-delimited file. But I don't think there is a proprietary name for the particular format you show.

El Ronnoco
A: 

I never saw this kind of data description before. But since it's in a coma separated format, I suppose it's still called CSV:

http://en.wikipedia.org/wiki/Comma-separated_values

But I think this way of saving this way uses a lot of unnecessary bytes since you repeat the uniqueID a lot and the attribute names too. The only advantage I can see is that the data can be randomly placed in a file. Other than that, text files are usually read sequentially.

--- Edit ---

From the wiki, there is a list of human readable formats. If none of them suits you and still want to use your format and use a name, you could always use a more generic name like Delimiter separated value instead of CSV or invent a new one like key-field-value (KFV).

AngeDeLaMort
A: 

The structure is called Key-Value table. And you have serialized that table as a CSV file.

Joshua Flanagan
+1  A: 

Took some time, but I found it.. it's Entity Attribute Value (EAV).

jcoon