PyTranspose is a Python script that "rotates" a delimited text file, so that the columns become rows (and vice-versa). It will run in any environment that has python installed without requiring compilation.
This software is still a bit rough because it's in severe alpha. I expect it to become beta by October 2011. I can't guarantee that it will production-ready ever, but if enough people use it and give me feedback, then who knows?
To use transpose, you need a computer with Python 2.X installed. Mac and Linux should have this already installed.
Suppose you have a text file that looks like this:
$ cat test
Hello, my name is Michael.
Goodbye, I must be going.
If we wanted to transpose on the whitespace, we would type:
$ transpose.py -w test
Hello, Goodbye,
my I
name must
is be
Michael. going.
transpose.py --whitespace is equivalent to transpose.py -w
If we wanted to transpose on the comma, we would type:
$ transpose.py -d=,
Hello,Goodbye
my name is Michael., I must be going.
transpose.py --delimiter is equivalent to transpose.py -d
To get help, type:
$ transpose.py --help
PyTranspose will automatically detect what operating system you are using, and if you are using windows it will automatically format your output file correctly. However, there may be occasions where you need to take windows input and output to a UNIX format, or vice-versa. You can do this using the dos2unix and unix2dos utilities:
$ transpose.py unix-input.txt | unix2dos > win-output.txt
$ transpose.py win-input.txt | dos2unix > unix-output.txt
Alternatively, you can use the --unix and --win flags:
$ transpose.py unix-input.txt --win -o=win-output.txt
$ transpose.py win-input.txt --unix -o=unix-output.txt
The -U flag (note: capitalized!) is equivalent to --unix; the -W flag (also note: capitalized!) is equivalent to --win.
I encourage you to use this script and to tell me what you think, whether it sucks or rocks, and what you need me to fix or would like for me to change about it. I'm not kidding. I can't make this code work better, and grow as a programmer, without your feedback.