Skip to main content

How to Read CSV File using Golang

CSV (Comma Separated Value) is a popular file format to store and share data. The CSV files are widely used in web applications to export and import dynamic data.

In our previous tutorial you have learned how to parse JSON file in Golang. In this tutorial you will learn how to read and parse CSV file data in Golang. The Go provides encoding/csv package to read CSV file. We will use this package to handle CSV file parsing.

We will cover this tutorial step by step to create a CSV file with some sample data. Then we will open CSV file and read CSV file data and store CSV file data into an object. Then display CSV file data using object. (more…)

Parsing JSON Data using Golang

JSON (Javascript Object Notation) is a standard format for storing data. The JSON format is the most used format in web applications to read and write dynamic data. Most of RESTful APIs are implemented to return JSON data response.

As in our previous tutorial you have learned how to Read File Line by Line using Golang. Here in this tutorial we are going to explain how to parse JSON data using Golang to implement in your web applications.

We will cover this tutorial step by step to create a JSON data file and read JSON file data. The we handle functionality to parse JSON. (more…)

Read File Line by Line using Golang

Reading a file is very common functionality of programming languages. The files read and write functionality implemented in web applications.

In our previous tutorial you have learned how to read Read CSV File using Golang. In this tutorial you will learn how to implement functionality to read file line by line using Golang. We will create a text file and read text file line by line to display data using Golang.

We will cover this tutorial step by step to create a Go file to implement functionality to read text file line by line and display file data.

The Go has bufio package to read files line by line. In this tutorial, we will use this package to read file line by line. (more…)