reading-isam-files

Reads records from Divalto ISAM binary files via DhxIsam64.dll using ctypes.

6|Updated May 11, 2026
One-click install
npx skills add https://github.com/divalto/divalto-ia-devkit --skill reading-isam-files-divalto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reading-isam-files
Source: https://github.com/divalto/divalto-ia-devkit/tree/main/plugins/divalto-devkit/skills/reading-isam-files
Command: npx skills add https://github.com/divalto/divalto-ia-devkit --skill reading-isam-files-divalto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Divalto ERP stores configuration data (zooms, menus, multichoix dictionaries) in proprietary indexed binary .dhfi files that cannot be inspected with standard tools. This Skill lets you query those files directly from Python to audit, debug, or verify ERP configuration without opening the Divalto client. ## Core Features & Use Cases - Keyed and sequential reading: Read records by index key (e.g. A4 for zooms, A2 for menus), position on a specific key value, or scan sequentially forward and in reverse. - Filtering and projection: Apply cumulative Champ=Valeur filters and return only selected fields, with results emitted as structured JSON. - Pre-built record structures: Ships validated JSON structure definitions for A5F zoom tables (M4, M1), Xmenuf menu tables (M2, M0), and the gtfdmc multichoix dictionary, plus a structure validator. - Use Case: You need to find which zoom record has ZoomNum=9490 in a5f.dhfi and see only its label and target file. Run read_isam.py with the M4 structure, key A4, a ZoomNum filter, and a field projection to get the answer as JSON in one command. ## Quick Start Ask the assistant to read the first five zoom records from a5f.dhfi using the M4 structure on key A4 and show the result as JSON.

Frequently Asked Questions about reading-isam-files

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read records from a Divalto .dhfi ISAM file?

Run read_isam.py with --file pointing to the .dhfi file, --structure pointing to a JSON record-structure definition, and --key naming the index (e.g. A4). The script calls DhxIsam64.dll via ctypes and prints matching records as JSON.

How do I filter and select specific fields when reading ISAM records?

Pass --filter "Champ=Valeur" (repeatable, combined with AND logic) to keep only matching records, and --fields "Champ1,Champ2" to project only those fields. Add --max N to cap the number of returned records.

Can I read a Divalto ISAM file in reverse order?

Yes, use the --reverse flag. The script positions at the end of the key range by appending a 0xFF byte to the TDF key and reads with xisam_tpreadlong in shared reservation mode, returning records in descending key order.

Why does my ISAM scan stop at about 1003 records?

The DLL reservation table holds roughly 1003 slots, and reading in mode R (or invalid alias codes like S/D/G) consumes one slot per record until saturation (return code 46). Use the default reservation mode P (shared) for read-only scans, which consumes no slots.

What are the requirements for running the ISAM reader on Windows?

You need Windows with DhxIsam64.dll installed at C:\divalto\sys\DhxIsam64.dll, Python 3, and a valid JSON structure file describing field offsets and sizes. The scripts use only the Python standard library (ctypes, argparse, json).

Why do I get garbage values when scanning menu records in g3f.dhfi?

The g3f.dhfi file mixes two record tables: M0 (Ce=0, domain header) and M2 (Ce=2, menu choices). Scanning with the M2 structure without a filter decodes the M0 record with M2 offsets. Always add --filter "Ce=2" for menu choices or "Ce=0" for the header.