⌘ ZEUS Interface Quality · CSV · Legacy Files
One contract for delimiters, positions, and real file failures
Automatically Validate CSV and Legacy Files: Profiles for Interfaces
A file can be readable and still violate the agreed contract: a required column is missing, a number is delivered as text, or a record is shifted by one position. File interfaces therefore need more than an editor that can open the file; they need systematic checks.
Iteration 2 of ZEUS Interface Quality adds two local validation paths: CSV files and fixed-width files. Both use the same report and exit codes as JSON validation. Their rules live in separate profiles because CSV and legacy layouts make different assumptions.
The broader approach is described on the English Project Page. Iteration 1 covers JSON Schema; this article follows the next vertical slice from a file profile to a reproducible result.

What Iteration 2 delivers
This slice stays local and focused. It does not immediately add FTP, SFTP, or a complete legacy compiler; it first validates files once they are available.
- CSV: delimiter, encoding, exact header, column count, and column rules.
- Fixed-width: encoding, record length, one-based positions, and field lengths.
- Shared: required values, types, ranges, lengths, patterns, deterministic findings, and exit codes.
- CLI:
--input-format AUTOcan select CSV or fixed-width from the profile; explicit selection remains available. - Not included: transport, cross-record business rules, and automatic derivation from source code.
One result contract for multiple file formats
The validator uses a different adapter for each input format, but the result remains the same project object. A CI script does not need to know whether a finding came from JSON, CSV, or a fixed-width file.
| Case | Meaning | Exit code |
|---|---|---|
| VALID | The file matches the selected profile. | 0 |
| INVALID | The file is readable but violates at least one rule. | 1 |
| Check not possible | The file or profile cannot be read or parsed safely. | 2 |
A missing CSV value is a problem in delivered data. A broken profile or undecodable input prevents the check itself. Those cases need different treatment in operations.
Describe CSV with a small profile
CSV is not a complete contract. Delimiter, encoding, header, and column rules turn a sequence of fields into a meaningful, testable delivery. Iteration 2 uses a deliberately small JSON profile:
{
"format": "csv",
"version": 1,
"delimiter": ";",
"encoding": "UTF-8",
"header": ["deliveryId", "quantity", "email"],
"columns": [
{
"name": "deliveryId",
"type": "string",
"required": true,
"minLength": 1
},
{
"name": "quantity",
"type": "integer",
"required": true,
"minimum": 1
},
{
"name": "email",
"type": "email",
"required": true
}
]
}
The header is fixed in both content and order. A file with swapped columns is not “almost correct” when the contract is positional. Column rules stay with the column, so a finding can identify both its data and profile path.
Validate CSV files automatically
The valid fixture contains the same small delivery idea as the JSON test, now with semicolon delimiters. Quoted fields are handled by the CSV parser; profile validation begins after the records can be read.
deliveryId;quantity;email
DEL-1001;3;ops@example.org
DEL-1002;12;"warehouse@example.org"
Choose the adapter explicitly with --input-format csv, or leave the default AUTO in place. The CLI reads format from the profile and selects CSV or fixed-width.
$jar = "target/zeus-interface-quality-0.1.0-SNAPSHOT.jar"
$profile = "src/test/resources/fixtures/csv/delivery.csv-profile.json"
$input = "src/test/resources/fixtures/csv/valid-delivery.csv"
java -jar $jar validate --input-format csv --schema $profile --input $input --report json
$LASTEXITCODE
The invalid fixture contains three instead of an integer:
{
"status" : "INVALID",
"valid" : false,
"findings" : [ {
"instancePath" : "/rows/0/quantity",
"schemaPath" : "/columns/quantity/type",
"keyword" : "type",
"message" : "Zeile 2, Spalte quantity: 'three' ist keine ganze Zahl"
} ]
}
/rows/0/quantity means the first data record and its quantity column. The human-readable message includes the physical line number after accounting for the header.
Validate fixed-width and legacy files
Fixed-width files have no delimiter and often no header. A field’s meaning comes from its position; one extra character can shift every field after it. The profile therefore fixes record length and field boundaries.
{
"format": "fixed-width",
"version": 1,
"encoding": "UTF-8",
"recordLength": 31,
"sourceLanguage": "COBOL",
"columns": [
{ "name": "recordType", "start": 1, "length": 1, "type": "string", "required": true, "pattern": "^D$" },
{ "name": "deliveryId", "start": 2, "length": 10, "type": "string", "required": true, "minLength": 1 },
{ "name": "quantity", "start": 12, "length": 5, "type": "integer", "required": true, "minimum": 1 },
{ "name": "email", "start": 17, "length": 15, "type": "email", "required": true }
]
}
Positions start at one and are measured after decoding. Field boundaries are trimmed by default so padded values can still be checked. A wrong record length is its own finding; the line is not reinterpreted with shifted fields.
DDEL-1001 3ops@example.org
The invocation is the same except for the adapter and profile:
$jar = "target/zeus-interface-quality-0.1.0-SNAPSHOT.jar"
$profile = "src/test/resources/fixtures/fixedwidth/delivery.cobol-profile.json"
$input = "src/test/resources/fixtures/fixedwidth/valid-delivery.dat"
java -jar $jar validate --input-format fixed-width --schema $profile --input $input --report json
$LASTEXITCODE
COBOL and RPG as provenance, not coupling
A legacy definition may come from a COBOL copybook, RPG/RPGLE, DDS, or a database description. The first validator does not need to parse the language. It needs the approved layout description that came out of that work.
For that reason, a fixed-width profile may contain sourceLanguage: COBOL or sourceLanguage: RPG. The metadata documents provenance; it does not change the parsing algorithm. A future generator could create a draft from a copybook, RPGLE definition, or DDL, but approving that draft remains a domain and engineering decision.
Read findings and exit codes
{
"status" : "INVALID",
"valid" : false,
"findings" : [ {
"instancePath" : "/records/0/quantity",
"schemaPath" : "/columns/quantity/type",
"keyword" : "type",
"message" : "Zeile 1, Spalte quantity: 'three' ist keine ganze Zahl"
} ]
}
The fields status, valid, and findings remain stable across adapters. Automation should use status, path, and keyword; the current human-readable messages are not the long-term machine contract.
Why the core stays technology-neutral
The shared core knows result objects and the validator interface. JSON Schema, CSV, and fixed-width profiles live in separate adapters. Apache Commons CSV is an implementation detail of the CSV adapter; it is not part of the core contract.
| Component | Responsibility | Deliberately not included |
|---|---|---|
core |
Finding, status, result, and port | No CSV, fixed-width, or parser-library knowledge |
adapter.csv |
Quoting, delimiter, header, and column rules | No FTP/SFTP connection or universal JSON model |
adapter.fixedwidth |
Record length, positions, and layout rules | No COBOL/RPG parser or source interpretation |
cli |
Format selection, report, and exit code | No cross-file orchestration |
The automated evidence
The tests cover valid files, type errors, missing required values, wrong CSV headers, wrong column counts, malformed CSV quoting, fixed-width length errors, and invalid profiles. The local evidence does not yet prove SFTP retrieval, delivery windows, or business correctness.
🟢 Reproducible run
The repository contains profiles and fixtures beside the Java code. The Iteration 2 source run executed 64 tests; two Windows symbolic-link tests may be skipped when the local permission is unavailable. The package build then starts the real JAR with valid and invalid CSV and fixed-width fixtures.
What is deliberately not included
- no FTP or SFTP adapter and no authentication;
- no filename, delivery-window, hash, or quarantine workflow;
- no business rules across records or files;
- no automatic derivation from DDL, COBOL copybooks, DDS, or RPGLE;
- no byte-level fixed-width semantics or special EBCDIC profiling;
- no size or runtime limits beyond the current development scope.
Conclusion: profiles make file contracts visible
Iteration 2 adds two practical file adapters without pretending that CSV and legacy layouts are the same problem. Profiles make delimiters, headers, positions, and scalar rules visible; the shared result model keeps automation consistent.
The next transport layer can now be added deliberately. The English Project Page records the broader roadmap, and Iteration 3 covers the HTTP slice.
Code and sources
Source edition status: September 17, 2026. The examples describe the completed Iteration 2 state.
Transparency Notice
Content published on tiny-tool.de is carefully researched, editorially reviewed, and updated regularly. Sources and quotations are provided in a transparent and traceable manner wherever possible. However, we do not guarantee the accuracy, completeness, or timeliness of the information provided. Errors cannot be ruled out.
Editorial Responsibility and Use of AI: Digital tools – including AI-based assistance systems – may be used to support research, structuring, language refinement, translation, code analysis, or visual production. Published content is editorially reviewed, revised, and approved by Guido Zeuner. Content selection, contextualisation, and publication remain under human responsibility. AI-generated output is not treated as an independent source. AI systems are not responsible authors or editors. More information about our use of AI in texts, images, videos, and digital personas is available on our AI Transparency page, which is currently available in German.
Audience Measurement (VG WORT / METIS): VG WORT tracking markers may be used to measure the reach of individual texts. As part of the METIS audience measurement process, a client ID may be generated and a so-called “METIS Session Cookie” may be set. The measurement is used to determine statistical access figures and as a basis for possible VG WORT remuneration. According to VG WORT, no personal usage profiles are created, and the measurement is not used for advertising or marketing tracking. More information is available in our Privacy Notice, which is currently available in German.
Please note: The content provided on this website is for general informational purposes only and does not constitute professional advice, including legal, tax, medical, technical, financial, or other specialist advice. Use of the content is at your own responsibility.
Advertising and Affiliate Links: Some posts may contain promotional references or affiliate links. These are identified accordingly. Clicking such links does not result in any additional cost to you; we may receive a small commission.
Trademark Notice: All brand names, logos, and product names are the property of their respective rights holders and are used solely for identification and descriptive purposes. No affiliation with the companies mentioned is implied unless explicitly stated.
External Links: This website contains links to external third-party websites. Although links are reviewed carefully, we assume no responsibility for the content of external websites. If we become aware of unlawful content, the respective links will be reviewed and removed where appropriate.



tiny-tool.de
tiny-tool.de