Un-crosstab data in a text file.
un-xtab.py is a Python module and command-line program that rearranges data from a crosstabulated format to a normalized format. It takes data in this form:
and rearranges it into this form:
Input and output are both text (CSV) files.
You can use the un-xtab program to rearrange data that have been provided in a format designed for readability into a format that is more suitable for storage in a database, or for use with statistical, modeling, graphics, or other software.
The un-xtab program can deal with crosstabbed formats that include multiple rows of column headers and groups of data values that were crosstabbed together.
A row number can be added to assist with post-processing of the output file, if necessary.