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

Support for skip_rows_after_header option in reading csv files #782

Merged

Conversation

JonGretar
Copy link
Contributor

Adds support for the skip_rows_after_header option.

This is helpful when dealing with generated CSV from scientific instruments that may have metadata after the header row.

For example when we look at this CSV file:

"TOA5","6843","CR3000","6843","CR3000.Std.22","CPU:CA_Flux__GOOD.CR3","24006","ts_Above"
"TIMESTAMP","RECORD","Ux","Uy","Uz","co2","h2o","Ts","press","diag_csat"
"TS","RN","m/s","m/s","m/s","mg/m^3","g/m^3","C","kPa","m/s"
"","","Smp","Smp","Smp","Smp","Smp","Smp","Smp","Smp"
"2012-06-07 13:00:00.05",111868400,0.468,-0.9077501,0.1785,659.7584,9.530561,28.52527,100.1938,0
"2012-06-07 13:00:00.1",111868401,0.60275,-1.0795,0.283,660.0234,9.492132,28.51141,100.1938,0
....

In this case we want the second row as the header and would use the following call:

Explorer.DataFrame.from_csv!(csv_path, skip_rows: 1, skip_rows_after_header: 2)

Closes #781

@billylanchantin billylanchantin merged commit 3e04fdb into elixir-explorer:main Dec 21, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

Select header row number when reading CSV files
3 participants