How to Read an Excel File in Julia Language? An example.

This article shortly describes how to read an Excel file into Julia. Generally, one can use different libraries to read Excel files, including XLSXReaderExcelReaders or Taro. In this tutorial I will focus on Taro as it created the fewest problems and provides – at least in my eyes – an easy to understand syntax.

In order to read an Excel file form your computer into Julia it is sufficient to execute the following lines of code. However, if you want to download the Excel file directly from the web and read it into Julia you should look at this post.

 
# in case you have not installed to Pkg yet
Pkg.add("Taro")

# load Taro - Pkg to read Excel Data
using Taro
Taro.init()

# get data
df = Taro.readxl("path to Excel", "sheet1", "A1:C357")

This code will read the selected data fields, i.e. field A1 to field C357, of sheet1 into a dataframe in Julia. You can also directly consult the documentation of the Taro Package here.

Advertisements
This entry was posted in Computing and Others and tagged , , , . Bookmark the permalink.

One Response to How to Read an Excel File in Julia Language? An example.

  1. Pingback: How to Read an Excel File dircetly form the Web in Julia Language? | Economic Theory Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s