release: Version 0.2.0 release
docs: Update README examples and to-do list
test: Removed tests for implicit errors from readTable
Reshape delimited text files.
Reads input from a file if the filename is given as the last argument.
Reads from stdin
stream (e.g. unix pipe) otherwise, until terminated by an EOF signal.
A filename argument of -
can also be used to switch to stdin
input.
Note that the whole input is read into memory at once for processing.
Transpose:
printf 'a,b,c'|reshape -d, -t
a
b
c
Reshape:
printf '%s\n%s\n' 'a,b,c' '1,2,3'|reshape -d, -s3x2
a,b
c,1
2,3
Output is right-aligned by default (use -p
or --nopad
to disable):
printf '%s\n%s\n%s\n' 'a,b,c' '1,2,3' 'foo,bar,baz'|reshape -d,
a, b, c
1, 2, 3
foo,bar,baz
Skip individual rows/columns or ranges:
printf '%s\n%s\n%s\n' 'a,b,c' '1,2,3' 'foo,bar,baz'|reshape -d, -r:1 -c:1-2
3
baz
Note that unicode symbols are currently not aligned properly:
printf '%s\n%s\n%s\n' ',a,b,c,d' ',1,2,3,4' ',",",,ß'|reshape -d, -c1 -s3x4
a,b, c,d
1,2, 3,4
",", ,ß,
After building the reshape
binary, put it in one of your $PATH
directories.
Release build: nim c -d:release src/reshape.nim
Debug build: nim c src/reshape.nim
Run nimble test
in the source code root directory.
Run with the --help
option if built, or check the printHelp
proc in the code.
Note that short options must not be separated from their arguments by a space.
Use :
or =
instead, or append the argument to the option flag directly.
This behaviour is inherited from Nim's parseopt module.