Source, documentation, and distribution code for un-xtab.py
Rev. | Zeit | Autor | Nachricht |
---|---|---|---|
ae700301eda1 | 2023-01-30 06:37:34 | rdnielsen | tip Modified to allow letters as column identifiers for the r... |
415764f4be19 | 2022-02-02 23:10:01 | rdnielsen | Cleanup |
6baeae66ed1d | 2022-02-02 11:09:21 | rdnielsen | Revisions for backwards-incompatible Python changes. |
cb48afc3993f | 2022-02-02 00:45:37 | rdnielsen | Changed to use argparse. |
12e72acef901 | 2021-08-17 23:03:46 | rdnielsen | Modified setup script, and renamed to .rst. |
1b85bfaf6d64 | 2021-08-17 11:40:51 | rdnielsen | Changed to seek(0) before truncating the output buffer. |
5603c3971159 | 2021-08-17 10:08:13 | rdnielsen | Allowed 'data_columns' to accept letters; documentation u... |
4bb4e6cc7398 | 2020-01-05 10:06:12 | Dreas Nielsen | Modified README and menu to reference OSDN instead of RTD. |
ab240c76d2d7 | 2020-01-03 23:13:03 | Dreas Nielsen | Changed repository in documentation; changed version in s... |
05201eb58057 | 2019-09-12 11:28:05 | Dreas Nielsen | Allowed the 'data_columns' setting to accept letter colum... |
Name | Rev. | Zeit | Autor |
---|---|---|---|
tip | ae700301eda1 | 2023-01-30 06:37:34 | rdnielsen |
Name | Rev. | Zeit | Autor | Nachricht |
---|---|---|---|---|
default | ae700301eda1 | 2023-01-30 06:37:34 | rdnielsen | Modified to allow letters a... |
un-xtab.py
Crosstabulate 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:
System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 8)
Line block ends without a blank line.|---------|------------|------------|------------| | WQ-01 | 4.5 | 3.7 | 6.8 | | WQ-02 | 9.7 | 5.1 | 7.2 | | WQ-03 | 10 | 6.1 | 8.8 |
and rearranges it into this form:
Input and output are both text (CSV) files.
System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 34); backlink
Inline literal start-string without end-string.System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 34); backlink
Inline interpreted text or phrase reference start-string without end-string.un-xtab.py [options] input_file_name output_file_name
--version | Show program's version number and exit |
-h, --help | Show this help message and exit |
-c CONFIGFILE, --configfile=CONFIGFILE | |
The name of the config file, with path if necessary. The default is to look for a configuration file with the same name as the input file, but with an extension of cfg, in the same directory as the input file. | |
-d, --displayspecs | |
Print the format specifications allowed in the configuration file, then exit. | |
-e ENCODING, --encoding=ENCODING | |
Character encoding of the CSV file. It should be one of the strings listed at http://docs.python.org/library/ codecs.html#standard-encodings. | |
-n ROWSEQ, --number_rows=ROWSEQ | |
Add a sequential number to each output row, with a column header of ROWSEQ. |
System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 57)
Option list ends without a blank line; unexpected unindent.-o, --outputheaders Print the output column headers, then exit. -p, --printconfig Pretty-print the configuration data after reading the
System Message: ERROR/3 (/tmp/formatreadme-rawwgUkzN, line 59)
Unexpected indentation.configuration file, then exit.
System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 60)
Block quote ends without a blank line; unexpected unindent.-s SPECNAME, --specname=SPECNAME | |
The name of the section to use in the configuration file. The default is to use the name of the input data file, without its extension. |
System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 64)
Definition list ends without a blank line; unexpected unindent.System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 64); backlink
Inline literal start-string without end-string.System Message: WARNING/2 (/tmp/formatreadme-rawwgUkzN, line 64); backlink
Inline interpreted text or phrase reference start-string without end-string.Complete documentation is available at OSDN.
Copyright (c) 2014, 2016, 2019, 2021, 2023, R.Dreas Nielsen
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The GNU General Public License is available at http://www.gnu.org/licenses/.