ISKRIT / engineering reference ← to reference

AGS4 syntax: the five rules that break a delivery

Updated: 2026-08-04 · ISKRIT

Rules 1 to 5 of the AGS Data Format govern the text of a single line. They sound trivial and they generate most rejected files, because the tools people export from do not know about them.

The line contract

Every field on every line is enclosed in double quotes and fields are separated by commas. Nothing else may appear outside the quotes, not a space after the comma, not a tab, not a trailing semicolon. A quote character inside a value is written twice. The first field of every line is a descriptor: GROUP, HEADING, UNIT, TYPE or DATA.

That is the whole contract, and each of its parts is a separate rule, which is why a single malformed line can produce three findings at once.

What actually triggers them

A borehole log that records a depth range as 1.20-1.50 m is fine. The same log with a remark like sand, 6" cobbles is not, unless the inch mark was doubled. Text fields copied from a word processor carry typographic quotes that look identical in a viewer and are a different character to a parser.

Spreadsheet exports produce the other classic failure: a value containing a comma, a soil description for instance, split across two fields. The line then has more fields than the HEADING line declares, which is a rule 7 count mismatch rather than a syntax fault, and the fix is quoting, not renumbering.

Reading the report

A useful validator reports the line number, the group the line belongs to and the specific defect, not just an invalid line. Characters found outside the quotes tell you a separator landed in the open; an unclosed field quote tells you a value swallowed the rest of the line. Both point at the same underlying mistake in different halves of the file, and the line number is what makes the fix a two-minute edit rather than a re-export.

Fixing without re-exporting

Line-level faults are safe to repair in a text editor, because they do not change any measured value. Quote the unquoted field, double the internal quote, delete the stray character. Group-level faults are not: adding a missing PROJ group by hand means inventing project metadata, and that belongs to whoever produced the data.

The AGS4 checker reports every line fault with its line number and group, so the file can be corrected in place.