Skip to content

Commit

Permalink
load_data
Browse files Browse the repository at this point in the history
  • Loading branch information
montyvesselinov committed Oct 15, 2023
1 parent 7b0dc8b commit 18e794a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MadsIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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"
Expand Down

0 comments on commit 18e794a

Please sign in to comment.