The
Text data source allows reading and writing data to a text file. Items are written positionally, using fixed widths. This data source is versatile and can read data from other applications, as long as the data can be described by a CSPro
dictionary, with records specified on multiple lines and items specified positionally. Stating in CSPro 7.0, the
CSPro DB data source became the default data source for CSPro, and because that data source has more functionality than Text, you are encouraged to use that format when possible.
The Text data source is used when a file has the extension
.dat, or when it has an extension not associated with another
data source. In other words, most extensions will map to a Text data source.
The Text data source supports the following features:
Feature | Supported |
Reading cases | ✔ |
Writing cases | ✔ |
Notes, case labels, and case statuses | ✔ |
Storage of more than one kind of record | ✔ |
Binary data items | ✘ |
Deleting cases | ✔ |
Undeleting cases | ✘ |
Syncing data | ✘ |
Cases with duplicate keys | ✘ |
Case identification via UUID | ✘ |
Contains an embedded dictionary | ✘ |
Allows record sorts | ✔ |
The Text data file only contains information about the data as defined by a dictionary. Associated case data is written to the following files:
- Notes: Notes entered by the operator are written to a text file with the extension .csnot.
- Statuses: Information such as whether a case has been partially saved or verified is written to a text file with the extension .sts. The file also contains information about case labels.
- Index: The index stores information about where cases are located in the data file, allowing CSPro to quickly lookup cases. Because the index is a SQLite database, it is possible to query the index using SQL statements.
Because newlines are used to indicate the start of a new record, if a value contains a
newline, the value must be escaped before writing. The
'' character is used to indicate a newline when writing data or writing entries to the
notes and
status files. For example, a value like
"Line 1\nLine 2" would be written as:
The following behavior can be customized by specifying properties in the
connection string. The default behavior is marked with ⁺⁺⁺.
Property Name and Values | Description |
|
"cache" | Determines if cases are cached in memory. This may be useful to advanced users who want to optimize programs that do a lot of case lookups. |
true | Cases are cached, meaning that a case is only read from the data source once. |
false ⁺⁺⁺ | Cases are not cached. |
CENSUS_2024_DICT=.\Census.dat|cache=true