Guide / File preparation

TMH 18 file format: semicolons, UTF-8 and empty fields

The TMH 18 file format has three record rules: UTF-8 text, a semicolon between fields and no missing fields. See how to follow them and what the check menu offers.

Watch the overview

About 3 minutes. A narrated explainer; the same words are below.

Read the video text
  1. 0:00A survey file is a long list of numbers, so the way it is written matters.
  2. 0:05If one small detail is off, the whole file can be turned away.
  3. 0:11Think of each record as one row in a table, with a fixed set of boxes.
  4. 0:16Every box has its own place, even when nothing is written in it.
  5. 0:22TMH 18, version four, section one point one, sets the basic record rules.
  6. 0:30The file is plain text in UTF-8, a semicolon separates the fields, and each record ends with a carriage return and line feed.
  7. 0:40The semicolon replaces the comma used in many CSV files.
  8. 0:45So a comma can sit inside a value, such as a road description, without splitting the field.
  9. 0:52An empty field is written as nothing at all, followed by its semicolon.
  10. 0:57It cannot be left out. If a field is missing from a record, the standard says the file will be rejected.
  11. 1:04This does not mean every file type uses semicolons.
  12. 1:08The K M L geometry file is XML, and the F 25 deflection file is comma separated.
  13. 1:16Before you export the whole file, count the semicolons in a few records.
  14. 1:21Keep your fields in the order the standard defines.
  15. 1:25Then choose Upload a file, pick the check template, and Upload and validate.
  16. 1:31Picture a record where one field has no value yet.
  17. 1:34The right way leaves two semicolons side by side.
  18. 1:38The wrong way writes only one, and the standard says the file is rejected.
  19. 1:48If a file truly uses commas, open it in Survey files and choose Check using commas between columns, from the Run checks again menu.
  20. 1:58A warning that cannot be dismissed stays on the result, so readers see a different delimiter was used.
  21. 2:06A UTF-16 file is refused before any record rule is tested.
  22. 2:11And passing is only the start. A result describes the checks that ran, not whether the measurements are right.
  23. 2:19So: save as UTF-8, put a semicolon between fields, and keep every empty slot.
  24. 2:26The full guide is at TMH18 dot com, slash articles.

What are the three TMH 18 record rules?

Section 1.1 of TMH 18, version 4 (headed 'Draft Version 4', October 2014), sets the record rules. A data file is plain text in UTF-8. A carriage return followed by a line feed, often written CR+LF, ends each record. A semicolon separates the fields.

The semicolon replaces the comma used in many CSV files. That lets a comma appear inside a value, such as a road description, without splitting the field. This guide is about these rules. TMH 18 data validation, the overview of the whole path from file to certificate, covers the rest.

  • Save the file as plain text in UTF-8.
  • End each record with CR+LF.
  • Put one semicolon between each pair of fields.

How do I write an empty (null) field in TMH 18?

The standard says an empty field is written as nothing at all, followed by the semicolon. The slot stays in the record. A null field cannot be left out, because every field has a fixed place in the record.

The standard also says all fields must be represented within a record or the file will be rejected. So a record with a missing slot is wrong even if the value you left out was empty. Count the semicolons in a few records before you export the whole file.

Does a TMH 18 file need a header row?

No. The standard says no file header is required, because the field order is predefined. It does not say a header must not be used, so do not read it as a ban.

When the first row of an upload looks like data, TMH18 Validator adds a header row of its own before it checks the file. The checks then read each column against the field the check template expects in that place. Keep your field order exactly as the standard defines it.

Do all TMH 18 file types use semicolons?

No. The .kml geometry file is XML (OGC KML 2.2), and .kmz is its compressed form. Neither is delimited text, and the standard describes them in sections 2.3 to 2.6. The .f25 raw deflection file is comma-separated, in fixed columns with a line ID, as section 5.8 and Appendix A describe.

TMH18 Validator accepts .csv, the TMH 14 .rsv and .rss files, and fifteen extensions that it groups as TMH 18 files, including .f25. Some of these, such as .flx and .vgi, are not defined in TMH 18 version 4. It does not accept .kml or .kmz. An upload of one is refused with the message that the file type is not accepted.

When should I check using commas between columns?

Open a file in Survey files and run its checks. The Run checks again menu then offers Check using commas between columns, below Run checks again. It is shown only to people allowed to run checks again, and not on a certified file. Use it only if the file really separates its columns with commas. The menu item is not shown until a check has run, and it is not available while a reupload is waiting.

The choice is recorded in the activity history. When the template declares a delimiter other than a comma, the result also carries a warning, DELIMITER-OVERRIDE-COMMA, which cannot be dismissed. The note stays so that anyone reading the result can see the file was checked with a different delimiter than the template declares.

A comma re-check does not turn a comma file into a TMH 18 file. If the standard's rules apply to your delivery, fix the export and upload again.

What if the upload is refused before checks run?

TMH18 Validator refuses a UTF-16 file, with or without a byte order mark. It refuses before any record rule is tested. Why an upload is refused before any checks run explains this and the other early refusals.

A passed encoding test is only the start of the review. The findings describe the checks that ran. They do not show that the measurements are right.

Put it into practice

Upload a file

Sign-in and the relevant account permissions are required.