The often misunderstood CSV file format.
https://pixabay.com/illustrations/big-data-data-tunnel-data-highway-4240406/

The often misunderstood CSV file format.

Interfacing information between different systems is a critical task for any enterprise large or small. Tax reporting, federal reporting, state reporting, sharing data between systems, and even web service and ajax data access are just some of the interfacing concerns that are faced.

Sometimes you don't have a choice on the format the data must be in when sending data to other systems. But where you do have a choice, CSV format should be at the top of your list. It is THE smallest size of any format and, as a result, it has the fastest transfer speed. It also has very simple rules that guarantee flexibility. The following is the most common set of rules.

  1. Separate data using a comma (standard) or another character like a tab or pipe
  2. Enclose strings using double-quotes to allow commas in strings. (if needed)
  3. Escape double-quotes inside strings using a designated escape character; usually backslash (\"). (if needed)
  4. Escape the designated escape character if used in string data (\\). (if needed)

Example:

"001416","David \"The Tank\"","Davidson, II",33

Those coming from XML or JSON may say, "That data is not self describing." Easy... just put a single header row with the field titles in it. With a field title header, the data fields in the file could be in a different order but still be loaded properly by the receiver. (But most interfaces require consistent ordering... which isn't hard to do, and thus, they don't need a header.)

"employeeNumber","firstName","lastName","age"
"001416","David \"The Tank\"","Davidson, II",33

Still not good enough? Then put another row below the header to describe the data type or other information. (Though most interfaces already know what the data is without being told.)

What about object-relational data? Again, easy... just add fields that identify the data being stored and describe the relationship for related data (much like foreign keys in a database table). Each row can have the format needed for the data being stored.

"Employee","001416","David \"The Tank\"","Davidson, II",33
"Dependent","001416","Margot","Davidson","Wife"
"Dependent","001416","Julie","Davidson","Daughter"
"Benefit","001416","Health","Family Plan"
"Benefit","001416","Vision","Family Plan"
"Benefit","001416","Dental","Family Plan"

Another benefit of CSV is that it does not require complex data structures or libraries to use it (though I'm sure they exist). CSV is simple to build and simple to parse so you can write your own code without a lot of effort.

Following the simple rules of CSV means your data can contain ANYTHING and will be small, light, and speedy!

this and many more reason why I love you, Dennis.  You are one of the most gracious man and your patience is your best skill.  Miss you guys

Like
Reply

To view or add a comment, sign in

More articles by Dennis Payne

  • API: Application Programming Interface or Another Perpetual Iteration?

    My first experience with an API was not a good one. Assumptions are Never Good The API author assumed that I would want…

  • The Power Behind the Magic

    When I watch movies like the Wizard of Oz, I always remember the all powerful Glinda. With an effortless wave of her…

  • The Legacy of Professional Triumph

    Sand Castles One of my most favorite activities at the beach is making sand castles. It appeals to my creative side.

  • DevOps, Lemonade, and Good Business

    In business it is a common thing to departmentalize the work to be done. Sometimes the lines get drawn a little too…

  • DevOps: People First, Processes Second

    Wikipedia defines devops as a "software development methodology" that combines development with operations. [WIKI]…

  • Your Professional Advancement

    There are people who crave for opportunities for advancement, but many fail to prepare themselves for it and…

  • Are You Drowning in Complexity?

    In the world of IT it is easy to feel like we are drowning in all the complexity we seem to need. There is just so much…

  • Containing Your World

    Pre-Fabricated Docker Hub (dockerhub.com) has an image for just about anything you would want to deploy.

  • Container Storage: "Ogres have layers"

    One of the first things to understand about docker containers is how their file system is stored. Each container has…

  • Getting Real With Docker

    Warning: This gets geeky, but not detailed. You have been warned.

    1 Comment

Others also viewed

Explore content categories