Skip to content

Feature: loadtxt skiprows and max_rows #652

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

Merged
merged 15 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
loadtxt: treat negative skiprows as 0 (numpy like)
  • Loading branch information
MuellerSeb authored Apr 20, 2022
commit 5af87c6f19d707a510dbcb7d98f66432b0acc91f
4 changes: 1 addition & 3 deletions src/stdlib_io.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ contains
integer :: s
integer :: nrow, ncol, i, skiprows_, max_rows_

skiprows_ = optval(skiprows, 0)
if ( skiprows_ < 0 ) call error_stop("loadtxt: skiprows must be non-negative.")

skiprows_ = max(optval(skiprows, 0), 0)
max_rows_ = optval(max_rows, -1)

s = open(filename)
Expand Down