Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading sheets without column headings #97

Open
robertfeldt opened this issue Oct 15, 2020 · 1 comment
Open

Reading sheets without column headings #97

robertfeldt opened this issue Oct 15, 2020 · 1 comment

Comments

@robertfeldt
Copy link

Thanks for a useful package.

I just got a large excel file where the data has been split into separate sheets so only the first sheet has column headings. Is there a way I can manually give the column headings/names when reading in a sheet? (This way I can read the first sheet and then use its column headings when reading the other sheets)

Thanks for any pointers.

@hhaensel
Copy link

hhaensel commented Nov 10, 2023

I would do it this way:

data = reduce(vcat, readxlsheet.(Ref(f), f.workbook.sheet_names()))
df = DataFrame(data[2:end, :], string.(data[1, :]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants