An XER file is the plain-text, tab-delimited export format of Primavera P6, and it holds a schedule as a set of database tables. You can read one without P6: each table starts with a %T line, followed by a %F line of field names and one %R line per row of data, so a text editor, a spreadsheet or a short script will open it.
Reading it well takes a little more. The tables are linked by internal IDs, durations and float are stored in hours, and codes such as TK_Active or PR_FS need decoding. This guide sets out the file structure, the tables that matter most (PROJECT, TASK and TASKPRED) and what to check first.
What is an XER file?
XER is the native exchange format of Primavera P6, used to move projects between P6 databases. One file can contain one or more projects with their WBS, activities, relationships, calendars, resources and assignments, activity codes and user-defined fields. It is not a document but a dump of database rows.
On construction projects it is usually the file a contractor submits alongside a PDF of the programme. Reviewers ask for it because the PDF shows bars and dates, while the XER shows the logic, constraints, calendars and float that produce them.
What is the XER file format?
The file is line based, with fields separated by tabs. Each line starts with a marker that tells you what it is:
| Marker | Meaning | Example |
|---|---|---|
| ERMHDR | Header line at the top of the file | P6 version, export date and other export details |
| %T | Start of a table | %T TASK |
| %F | Field names for that table, in column order | task_id, proj_id, wbs_id, clndr_id, task_code, task_name ... |
| %R | One data row, values in the same order as the %F line | One activity, one relationship or one calendar |
| %E | End of file |
So a TASKPRED table is a %T TASKPRED line, a %F line listing fields such as task_pred_id, task_id, pred_task_id, proj_id, pred_proj_id, pred_type and lag_hr_cnt, then one %R line for each relationship. Every table in the file follows the same pattern, one after another.
Three details catch people out:
- Hours, not days: durations, lags and float are stored in hours (fields ending in hr_cnt). Convert them using the hours per day of the activity's calendar: an 80-hour activity on an 8-hour-day calendar is 10 days.
- Internal IDs: tables link through internal numeric IDs (task_id, wbs_id, clndr_id), not the Activity ID you see in P6. The Activity ID is task_code.
- Encoding: XER files are often written in a Windows code page rather than UTF-8, so accented characters in activity names can look garbled if the file is opened with the wrong encoding.
Which XER tables matter most?
| Table | What it holds | Key fields |
|---|---|---|
| PROJECT | One row per project in the file | proj_id, proj_short_name, last_recalc_date (data date), plan_start_date, scd_end_date (scheduled finish), plan_end_date (must finish by date) |
| PROJWBS | WBS nodes | wbs_id, parent_wbs_id, wbs_short_name, wbs_name |
| TASK | Activities | task_id, task_code, task_name, task_type, status_code, durations, dates, float, constraints, clndr_id |
| TASKPRED | Relationships | task_id (successor), pred_task_id (predecessor), pred_type, lag_hr_cnt |
| CALENDAR | Calendars | clndr_id, clndr_name, day_hr_cnt, clndr_data (work week and exceptions) |
| RSRC and TASKRSRC | Resources and their assignments to activities | rsrc_id, task_id, target_qty, act_reg_qty, remain_qty |
| ACTVTYPE, ACTVCODE, TASKACTV | Activity code types, code values and their assignment to activities | actv_code_type_id, actv_code_id, task_id |
| UDFTYPE and UDFVALUE | User-defined fields and their values | udf_type_id, fk_id, udf_text, udf_number, udf_date |
What do the main TASK fields mean?
- task_id and task_code: task_id is the internal key other tables link to. task_code is the Activity ID.
- task_type: TT_Task (task dependent), TT_Rsrc (resource dependent), TT_LOE (level of effort), TT_Mile (start milestone), TT_FinMile (finish milestone) and TT_WBS (WBS summary).
- status_code: TK_NotStart, TK_Active or TK_Complete.
- target_drtn_hr_cnt and remain_drtn_hr_cnt: original duration and remaining duration, in hours.
- Dates: act_start_date and act_end_date (actuals), early_start_date and early_end_date, late_start_date and late_end_date, and target_start_date and target_end_date (planned dates).
- total_float_hr_cnt and free_float_hr_cnt: total and free float, in hours. Do not confuse these with float_path, which only holds the path number when multiple float paths were calculated.
- cstr_type and cstr_date: the primary constraint and its date, with cstr_type2 and cstr_date2 for a secondary constraint. Values include CS_MSO (Start On), CS_MSOA (Start On or After), CS_MSOB (Start On or Before), CS_MEO (Finish On), CS_MEOA (Finish On or After), CS_MEOB (Finish On or Before), CS_MANDSTART and CS_MANDFIN (mandatory start and finish) and CS_ALAP (As Late As Possible).
- clndr_id: the calendar the activity is scheduled on, which you need to convert its hours into days.
How do relationships work in the TASKPRED table?
Each TASKPRED row is one link. task_id is the successor and pred_task_id the predecessor, both as internal IDs, so join them to the TASK table to see Activity IDs and names. pred_type is PR_FS, PR_SS, PR_FF or PR_SF (Finish-to-Start, Start-to-Start, Finish-to-Finish, Start-to-Finish). lag_hr_cnt is the lag in hours, and a negative value is a lead.
Where proj_id and pred_proj_id differ, the link is to an activity in another project. That project may not be in the file, so the external link will appear to point at nothing.
How can you open an XER file without P6?
1. A text editor
Any text editor opens an XER. It is the quickest way to check the header (P6 version and export date), see which tables are present and search for last_recalc_date. It is impractical for reading the schedule itself, and very large files can be slow to open.
2. A spreadsheet
Import the file as tab-delimited text. Renaming it to .csv does not work reliably because CSV expects commas. Every table then arrives stacked in one sheet, each with its own field-name row, so split it at the %T lines into one sheet per table. Relationships only make sense once TASKPRED is joined to TASK on task_id. This is workable for a small file and error-prone for a large one.
3. A short script
A few lines of Python or a similar language can split the file at each %T line, use the %F line as column headings and produce one table per XER table. It is repeatable, which makes it the best option when you need to compare two updates of the same programme.
4. An XER viewer or schedule-checking tool
Several third-party products read XER files and show a Gantt chart, the logic and standard checks. Before using one, find out whether it processes the file on your computer or uploads it to a server, and check that your contract's confidentiality terms allow it.
5. Import into P6
Importing into P6 is the only way to see the schedule as the issuer saw it, and it requires a P6 licence. Import into a separate EPS node or test database so nothing is overwritten. Layouts and filters are not normally carried in the XER, so ask the issuer for PDFs of the agreed layouts as well.
What should you look at first when reading an XER?
- Header: P6 version and export date. The export date tells you how recent the file is.
- PROJECT table: how many projects the file contains, the data date (last_recalc_date) and the scheduled finish (scd_end_date). Check the data date against the cut-off stated in the update narrative. Our guide to the data date in Primavera P6 explains why this comes first.
- Activity count and status: count activities by status_code. Look for activities marked complete without an actual finish, and for actual dates after the data date (invalid dates, where the DCMA target is zero).
- Logic: find activities with no predecessor or no successor in TASKPRED. DCMA expects fewer than 5% open ends, and a well-built programme normally has only one start and one finish milestone without them. Check the relationship mix (at least 90% Finish-to-Start), leads (zero) and lags (fewer than 5% of relationships).
- Constraints: list every activity with cstr_type populated. Hard constraints (Start On, Finish On, Start On or Before, Finish On or Before and the mandatory constraints) should be fewer than 5% of activities, because they override logic.
- Float and duration: convert total_float_hr_cnt and remain_drtn_hr_cnt to days. DCMA targets no negative float, and fewer than 5% of activities with total float or remaining duration over 44 working days.
- Calendars: check which calendars are used and their hours per day, so every conversion from hours to days is right.
What are the common pitfalls when reading an XER?
- Reading hours as days: a remaining duration of 400 looks alarming until you divide by the calendar's hours per day.
- Joining on Activity ID: join on task_id. Activity IDs can repeat across projects in a multi-project file.
- Missing relationships: activities without predecessors or successors break the critical path and make float meaningless.
- A stale data date: a data date well before the export date suggests the file was not progressed to the current period, or that an old copy was sent.
- Stored values that are out of date: dates and float in the XER are as last calculated. If activities were edited after the last reschedule, those values no longer match the logic.
- Misreading negative float: negative float means forecast dates are later than a constraint or the project must finish by date. It shows a forecast missing a target date, so check which date is driving it before concluding the project is late.
- Excessive constraints: large numbers of Finish On or Before or mandatory constraints can force dates that the logic does not support.
For a submitted programme, the XER is the evidence and the PDF is a picture of it. Reading contractor XER files against these checks is part of how Project Assure reviews programmes in its project planning work, before the schedule is accepted as a baseline or used to support a claim.
