Search code examples
file-format

What file-format is this?


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,bsmith@email.com,bsmith,Bob likes chicken
John,Doe,jdoe@email.com,jdoe,
Steve,Jobs,STEVE@apple.com,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:

bmsith@email.com,FirstName,Bob
bmsith@email.com,LastName,Smith
bmsith@email.com,Email,bmsith@email.com
bmsith@email.com,UserName,bsmith
bmsith@email.com,Notes,Bob likes chicken
jdoe@email.com,FirstNameJohn
jdoe@email.com,LastName,Doe
jdoe@email.com,Email,jdoe@email.com
jdoe@email.com,UserName,jdoe
STEVE@apple.com,FirstName,Steve
STEVE@apple.com,LastName,Jobs
STEVE@apple.com,Email,STEVE@apple.com
STEVE@apple.com,UserName,STEVE
STEVE@apple.com,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.


Solution

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