Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ctools/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (25 sloc)
1.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ctools | |
Python scripts for modifying (key,value) text files | |
The C in CTools stands for "Clause files". These are text files | |
that contain records. Each record consists of multiple lines, each line | |
is a key,value pair. For example: | |
``` | |
ARCHIVE: healthdata | |
NETID: abc12345 | |
GROUP: healthdata | |
COUNT: 3561789 | |
``` | |
A space, and an optional colon (:), separates each key and value the line. | |
Individual records are separate by one or more blank lines. | |
Clause files can carry the same information as spreadsheets, but they | |
have the advantage of being easier to edit from a text editor. In addtion, | |
the script ''flatten'' can be used to convert a clause file to a CSV file, | |
which can then be read by a standard spreadsheet app. | |
The Ctools are | |
``` | |
flatten - convert a clause file to a text table, an HTML table, or a CSV file. | |
cgrep - similar to grep; print those records which match the search parameter | |
cmerge - merge two or more clause files on a specific key field | |
csort - sort records in a clause file by the value of a specific key, | |
or sort key,value pairs within a record by the value of the key. | |
``` |