From 18e794a11a2ac15f1813a074360dea3f79c0f020 Mon Sep 17 00:00:00 2001 From: monty Date: Sun, 15 Oct 2023 07:22:15 -0600 Subject: [PATCH] load_data --- src/MadsIO.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MadsIO.jl b/src/MadsIO.jl index 66f26901..1106169d 100644 --- a/src/MadsIO.jl +++ b/src/MadsIO.jl @@ -43,7 +43,7 @@ function checkhash(DATA::DATA)::Bool end end -function load_data(filename::AbstractString)::DataFrames.DataFrame +function load_data(filename::AbstractString, sheet::AbstractString="Sheet1")::DataFrames.DataFrame if !isfile(filename) @warn("File $(filename) does not exist!") return DataFrames.DataFrame() @@ -54,7 +54,7 @@ function load_data(filename::AbstractString)::DataFrames.DataFrame if e == ".csv" c = CSV.read(filename, DataFrames.DataFrame) elseif e == ".xlsx" - c = DataFrames.DataFrame(XLSX.readtable(filename, "Sheet1"; stop_in_empty_row=false, header=true)) + c = DataFrames.DataFrame(XLSX.readtable(filename, sheet; stop_in_empty_row=false, header=true)) elseif e == ".jld" c = JLD.load(filename, "data") elseif e == ".jld2"