diff --git a/stdlib_candidate/get-column.nu b/stdlib_candidate/get-column.nu index 9f5def4..988e086 100644 --- a/stdlib_candidate/get-column.nu +++ b/stdlib_candidate/get-column.nu @@ -1,7 +1,26 @@ -# This is a wrapper to get a row +# Documentation for get-col +# Written on 2021-03-28 06:58:50 by andras_io on discord def get-col [ - col_name:any # A 0 indexed row + col_index:int # A 0 indexed col_index ] { - get $col_name -} \ No newline at end of file + # meant to be used like `ls | get-col 1` + # ls | select $(ls | get | nth 2) + + each { + echo $it | select $(echo $it | get | nth $col_index) + } +} + +# Documentation for get-col2 +# Written on 2021-03-28 07:00:24 by johng on discord +def get-column [ + col_index:int # A 0 indexed col_index + ] { + + # meant to be used like `ls | get-column 1` + pivot | nth $col_index | pivot | get Column1 | skip +} + +# another working example is +# ls | keep 2 | drop column 3 \ No newline at end of file