This article shortly describes how to read an Excel file into Julia. Generally, one can use different libraries to read Excel files, including XLSXReader , ExcelReaders 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.
One thought on “How to Read an Excel File in Julia Language? An example.”