BIG DATA INSIGHTS — PART 1

Dr. Nithya Ramachandran
Analytics Vidhya
Published in
4 min readJun 18, 2021

--

CSV , JSON & XML Data Formats — How does they look like?

Introduction

In this VUCA world, data plays vital role in each and every sector of domestic growth. The data that is scraped,imported, exported or transmitted in internet may be of any format or category. Those data need to be fine tuned and processed to gather some findings. So, in this tutorial we are going to discuss on various data exchange formats.

Item 1: “How do I look like?” — Data

How to create a .csv file?

CSV stands for Comma Separated Values , a plain file that includes data separated by comma (,). It looks similar to excel file and is used to import or export huge volume of data. (e.g., Customer data, product data etc.,). In this tutorial, we are going to create simple dataset including an IPL cricket team and its captain details.Open a notepad file. Make the entry as shown in Item 2…

Item 2: Creating ipl.csv file- a quick short video

Now, if you just open that ipl.csv file, the file open similar to the screenshot shown in Item 3.

Item 3: ipl.csv file

How to create .json file?

JSON — JavaScript Object Notation is another text-based data interchange format to maintain the structure of the data. It follows some syntax in representing the data and sometimes used as a replacement of the XML file.It helps in transmitting data from server to client when you develop a web applications. Open a notepad file and type as shown in Item 4.

Item 4: ipl3.json file

Syntax Explanation: Here, “{“ braces indicates start of json file. “ipl” followed by (:) indicates the name of dataset. Next, the symbol “[“ indicates that ipl includes the following field and values. (field: team, captain) and values like CSK, Dhoni…

Note: (,) is to be used to separate each pair of field and values.. It also looks like dictionary creation used in python programming language.

At the end again close the square bracket (]) followed by closing curly braces (}).

It is quite simple that we have created the .json file. But, how can we validate the above created ipl3.json file? JSON validator use to check for schemas defined to create the key & value pair. To do so, we can try some free online json validator(s) like this https://www.freeformatter.com/json-validator.html

Item 5: json file validation — a quick short video

Thus, Item 5 shows how the JSON file gets validated.

How to create .xml file?

Extensible Markup Language that is used to store and transport data. It includes set of rules to define the format by which the data is to be represented. As json, it is an alternate data format used while transmitting data to and fro into the web applications. The syntax resemble similar to html tag. Open a notepad file and type as shown in Item 6.

Item 6: ipl.xml file

Opening and closing tags are to be used in XML file similar to html program. The difference between HTML and XML is that in html only predefined tags like html, head, title,body tags whereas XML supports the programmer to define their own tags like team, captain etc., team is an attribute and MI is here a value.

Note: ipl is the root/parent tag followed by players denotes every data items. Here, players tag is a child node. Finally, close the ipl tag.

It is quite simple that we have created the .xml file. But, how can we validate the above created ipl.xml file? XML validator used to check for a root element, closing tag, attributes quoted properly or not. It is also case sensitive.To do so, we can try some free online XML validator(s) like this https://www.liquid-technologies.com/online-xml-validator

Item 7: xml file validation — a quick short video

Thus, Item 7shows how the XML file gets validated.

Conclusion

In upcoming tutorial , we will discuss further on converting a file from one format into the another. Thank you,

--

--