JAKE
JAKE

Reputation: 263

crawl excel data automatically based on contents

I want to get data from many excel files with the same format like this:

sample XLSX file

What I want is to output the ID data from column B to a CSV file. I have many files like this and for each file, the number of columns may not be the same but the ID data will always be in the B column.

Is there a package in Julia that can crawl data in this format? If not, what method should I use?

Upvotes: 0

Views: 56

Answers (1)

Carlos Agarie
Carlos Agarie

Reputation: 4002

You can use the XLSX package.

If the file in your screenshot is called JAKE.xlsx and the data shown is in a sheet called DataSheet:

data = XLSX.readtable("JAKE.xlsx", "DataSheet")

# `data[1]` is a vector of vectors, each with data for a column.
# that way, `data[1][2]` correponds to column B's data.
data[1][2]

This should give you access to a vector with the data you need. After getting the IDs into a vector, you can use the CSV package to create an output file.

If you add a sample xlsx file to your post it might be possible to give you a more complete answer.

Upvotes: 1

Related Questions