How to convert CSV to JSON in PHP

In this example I am going to show you how to convert CSV to JSON using PHP programming language. CSV stands for comma separated values and JSON stands for JavaScript Object Notation. These are actually data formats used for representations. Having data formats in CSV and JSON are advantageous because of their light-weight, easy to representation and easy to parse. JSON format is currently widely used in REST response.

Continue

How to merge multiple CSV files into one using Python

In this tutorial I am going to show you how to merge multiple CSV files into one in Python. I am using two CSV files for this example. You may need to merge multiple CSV files into one in some situations for your business requirements. Your different CSV files might have some common headers amongst them and when you merge those CSV files you want to put unique headers for the final CSV file. Under each header you will write values from different CSV files. If there is no value…

Continue

How to convert CSV File to PDF File using PyFPDF in Python

Here I am going to tell you how to convert CSV to PDF file using PyFPDF library in Java programming language. CSV is a comma separated value and it can be opened as a plain text file or in Microsoft excel file. There are few advantages of CSV data: CSV format is considered to be standard format CSV is smaller in size and faster to handle CSV is simple to implement and easy to parse CSV is human readable and easy to edit manually CSV is processed by almost all…

Continue

How to convert PDF File to CSV File using iText API in Java

In this example I going to show you how to convert PDF file to CSV file. I will read the PDF file using iText library and write data to the CSV file using Java programming language. In my previous example I had shown how to convert CSV file to PDF file using iText library. As you know that CSV is a comma separated value, so I assume that the PDF file is having data in tabular format which would be converted into comma separated values. Related Posts: How to generate…

Continue

How to convert CSV file to PDF file using iText API in Java

Here I am going to tell you how to convert CSV to PDF file using iText library in Java programming language. I am going to use Java 7 or later version’s new feature Path API to read the CSV file and Java 8’s Stream API to split the comma separated line or record. I am going to show you how to read file content into byte array and how to convert byte array into String. Then I am converting the array of String into a list of String. Finally from…

Continue

How to insert CSV data into MySQL database using Python in different ways

Introduction This example will show you how to insert CSV data into MySQL database table directly. So we are going to create insert SQL statement for inserting data individually or we will also load the csv data directly into the MySQL table. CSV means Comma Separated Value, so it’s a plain text data. Each line of the file is data record. Each record consists of one or more fields separated by commas. Each line of data record is terminated by new line.

Continue

How to convert XML to CSV using Python

In this example we are going to see how we can convert XML data into CSV data. XML is an Extensible Markup Language and CSV is Comma Separated Values. In this example I am going to read both XML file and XML string and show you how to display the converted csv string data in console as well as in the output csv file. You can check also check how to convert csv to xml using Python. Both XML and CSV formats being language agnostic are widely used in different…

Continue