Skip to content

Commit

Permalink
Fix ranges for col-indices and select-column-range
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTheDr01ds committed Oct 2, 2024
1 parent 7b765e9 commit c5a708e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions stdlib-candidate/std-rfc/tables/col-indices.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ use ../conversions/into.nu *
use ./select-ranges.nu *

export def main [ ...ranges ] {
columns
| select ranges $ranges
let indices = (
$ranges
| reduce -f [] {|range,indices|
$indices ++ ($range | into list)
}
)

$in | columns
| select ranges $indices
| get item
}

0 comments on commit c5a708e

Please sign in to comment.