Opt In (Do Not Edit Here)

Showing posts with label CSV. Show all posts
Showing posts with label CSV. Show all posts

Jun 9, 2015

File Formats: DSV, CSV, XML




DSV - Delimiter Separated Values
  • It stores 2-dimensional arrays of data.
  • It separates the values in each row with specific delimiter charaters.
  • Sometimes first line or record of DSV file is considered as column headers.
  • Most common delimiters used are comma, tab, colon, vertical bar, space.
  • In DSV file, data items are separated by delimiter character.

The file type is known depend on which kind of delimiter is used
  • If delimiter is comma then it is CSV (Common Separated Values) file.
  • If delimiter is tab then it is TSV (Tab Separated Values) file etc.
Mostly double quote ("") are used to enclose each field which prevents the delimiter in actual field value from treated as a field separator.

CSV - Comma Separated Values
  • It stores tabular data i.e. numbers and text in plain text format.
  • It is common data exchange format widely used for consumer, business, and scientific applications.
  • In this comma is used as field separator.
  • Each record of CSV file contains one or more fields which are separated by commas.
  • CSV represents sets or sequences of records with identical column fields.
  • CSV can not represent the hierarchical or object-oriented database or the data.
  • File extension is ".csv".
  • MIME type is "text/csv".

Example-1
  
srno, name, country
   1, Mayur, India
   2, Neha, India
   3, Jasmin, USA
   4, Ishita, Iran

Example-2
   "srno", "name", "country"
   "1", "Mayur Dighe", "India"
   "2", "Neha Dixit", "India"
   "3", "Jasmin Robert", "USA"
   "4", "Ishita S.", "Iran"


XML - eXtensible Markup Language
  • XML is case sensitive markup language.
  • It is a textual data format which emphasize simplicity, generality and usability across the Internet.
  • It is widely used to represent arbitrary data structures.
  • XML document is a string of characters.
  • It contains start-tags and end-tags for each data item
  • start-tag is similar to <section>
  • end-tag is similar to </section>
  • File extension is ".xml".
  • MIME Type is "text/xml" and "application/xml".


Example
<?xml version="1.0" encoding="UTF-8"?>
<person>
             <srno>1</srno>
             <name>Mayur</name>              <country>India</country>

             <srno>2</srno>              <name>Neha</name>              <country>India</country>

             <srno>3</srno>              <name>Jasmin</name>              <country>USA</country>

             <srno>4</srno>              <name>Ishita</name>              <country>Iran</country>
</person>


----------------------------------------------------------------------------
Note: In next blog posts, I show you how to convert CSV file into other delimited file, and CSV to XML conversion. 

All Rights Reserved. 2014 Copyright SIMPLITONA

Powered By Blogger | Published By Gooyaabi Templates Designed By : BloggerMotion

Top