XPSWMM.xp Card Reader

80-Column Fixed-Width Punch Card Parser • DbFieldDef from Swmfield.c
CAiCE DB • SWMM3/4 Heritage

Drop .xp files or folder here

Each .xp file is auto-converted to SWMM5 .inp and downloaded

For engineers in 2040 wondering what an .xp file is:

The .xp file is the native format of XPSWMM — a hydraulic modeling application originally built by XP Software (Australia, ~1990) as a graphical front-end to the U.S. EPA's SWMM model. It is not binary. It is a text database of 80-column fixed-width card images — the same punch card format used by SWMM Version 3 in 1981. Each field sits at a fixed column position defined in the C source file Swmfield.c (1,491 fields). These models, many created around 2000, represent real sewer pipes, manholes, and storm drains that are still in the ground carrying water.

This tool reads the text cards, extracts node/link/job control data at the documented column positions, and can export to EPA SWMM 5 .inp format — including junctions, outfalls, storage nodes, conduits, orifices, weirs, pumps, cross-sections, losses, inflows, and coordinates. Load a file above, then see the Docs tab for full format documentation.

★ Batch Convert Folder — select a local folder of .xp files → convert all to SWMM5 .inp → download ZIP
★ GitHub Batch Convert — fetch a folder of .xp files from GitHub → convert all to SWMM5 .inp → download ZIP

What Is a .xp File?

A .xp file is the native database format of XPSWMM (later Innovyze XPSWMM, now Autodesk InfoWorks). It is plain ASCII text — not binary — organized as a flat database of fixed-width 80-column “punch card” records. The format directly inherits the SWMM Version 3 Fortran card-image architecture from 1974/1981, wrapped in the CAiCE database engine’s indexing system.

Every .xp file is simultaneously a card-image database (GROUP + CARD + DATA at fixed column offsets), a GIS topology store (ZZZN nodes + ZZZE edges with coordinates), and a complete hydraulic model (nodes, links, job control, rainfall, results).

Physical Record Structure

Every line in a .xp file follows this fixed-column layout (105 characters total):

Columns   Width   Content
[0:4]       4     GROUP   — Namespace (EXTR, RUNF, ZZZN, ZZZE, SWMM, ...)
[4:8]       4     SUB     — Sub-index (right-justified integer, 0-based)
[8:12]      4     CARD    — Card name (SP1N, D1, C1, B2, NODE, EDGE, ...)
[12:16]     4     CI      — Card index (usually 0)
[16:20]     4     OI      — Object Index (KEY: links record to its element)
[20:24]   4-5     Padding
[24/25:]   80     DATA    — 80-column card data (DbFieldDef offsets apply here)

Fields are extracted at exact byte offsets within the 80-column data payload, using positions defined in the C source file Swmfield.c (1,507 DbFieldDef entries). Column positions are 1-based (Fortran convention): a field at “column 13, width 8” means data.substring(12, 20).

GROUP Namespaces

GROUPFull NamePurpose
EXTRExtran (Transport)Primary hydraulic data — nodes, links, job control
RUNFRunoffRainfall-runoff subcatchments, Horton/Green-Ampt parameters
RAINRainfallPrecipitation data, IDF curves, rain gauge config
TRANTransport InterfaceFlow division, junction coupling, DWF patterns
GRUNGroundwaterGroundwater parameters, infiltration
SWMMSWMM ControlModel execution control, mode settings
ZZZNNetwork NodesGIS topology: node names, coordinates, connectivity
ZZZENetwork EdgesGIS topology: link names, FROM/TO node OIs
ZSYMSymbolsNamed constants, global database values
PLOTPlot SettingsGraph configuration, HGL profiles
SRPTSummary ReportReport configuration, display boxes
QASQuality AssuranceModel audit trail, QA/QC records

EXTR Node Cards

CardPurposeKey Fields
SP1NNode spatial data & flagsNODX(6,12), NODY(18,12), FLGOUTF(50,1), NODNAM(62,10)
D1Junction hydraulic dataGRELEV(13,8), QINST(31,8), Y0(40,7)
J3Outfall configurationKO(4,1) type code, DELTA(11,8) stage
E1Storage node dataZTOP(13,7) top elev, ASTORE(21,7) area
J2Depth-area tableA1–A7 area values at depth increments
I1Inflow configurationInflow type flags (hydrograph, time series)

EXTR Link Cards

CardPurposeKey Fields
SPDNLink & endpoint namesCNAME1(1,10), CNAME2(11,10) US, CNAME3(21,10) DS
SPDVType flags bitmapCOND1(1,1), PUMP1(8,1), ORIF1(15,1), WEIR1(22,1)
C1Conduit dataNKLASS(13,2), DEEP(25,7), WIDE(34,7), LEN(43,8), ROUGH(70,10)
C1AConduit auxiliarySLOPE(27,8), ZP1(52,8) & ZP2(61,8) invert offsets
F1Orifice dataONKLASS(23,1), AORIF(25,6), CORIF(32,4), ZP(37,7)
G1Weir dataKWEIR(22,1), YCREST(24,8), WLEN(44,6), COEFF(53,4)
H1APump dataIPTYP(1,2), PON(11,8), POFF(19,8), PSEL(51,20)

Cross-Section Shape Codes (NKLASS)

CodeShapeSWMM5CodeShapeSWMM5
1CircularCIRCULAR11Semi-EllipticalSEMIELLIPTICAL
2RectangularRECT_CLOSED12Mod Basket-handleBASKETHANDLE
3HorseshoeHORSESHOE13User-DefinedCUSTOM
4EggEGG14Arch PipeARCH
5Basket-handleBASKETHANDLE16ParabolicPARABOLIC
6TrapezoidalTRAPEZOIDAL17Rect (alt)RECT_CLOSED
7Power FunctionPOWER18Semi-CircularSEMICIRCULAR
8Natural ChannelIRREGULAR19Rect Round-bottomRECT_ROUND
9GothicGOTHIC20Rect Tri-bottomRECT_TRIANGULAR
10CatenaryCATENARY

ZZZN:NODE — GIS Node Topology

Each node gets 3 records (all sharing the same OI as SUB): Record 0 = name + type + edge OI references, Record 1 = extended connectivity, Record 2 = X/Y coordinates.

Two format generations: Standard format (pre-v12) stores the node name at column 0 of the data payload. New format (v12+) prefixes a type code at column 3 and stores the name starting at column 11. Detection: if characters 0–2 are spaces and character 3 is a digit → new format.

ZZZE:EDGE — GIS Link Topology

Each link gets 2 records: Record 0 = link name + FROM/TO node OIs + edge type code, Record 1 = display properties. The edge OI appears in the data and the FROM/TO node OIs are the integers preceding it that match known node OIs from the ZZZN records.

Job Control Cards (OI=0)

CardPurposeKey Fields
A1TitleALPHA(5,75) title text
B1Time parametersDELT(10,6) time step, INTER(30,4) print interval
B2Units & limitsMETRIC(4,1): 0=US Customary, 1=Metric
BB2Solver parametersMFAIL(6,8), FUDGE(15,8), KINE(79,1) routing method

KINE routing codes: 0 = Standard Dynamic Wave, 1 = Always Non-linear, 2 = Never Non-linear, 3 = Kinematic Wave, 4 = Diffusion Wave.

Format Detection

This parser auto-detects three input formats:

1. Native .xp (CAiCE database) — Lines match fixed-column pattern with known GROUP names in columns 0–3.
2. RTF-wrapped .xp — {\rtf1...} header with \par line breaks; auto-stripped before parsing.
3. XPX interchange — Contains [NODE] or [LINK] section headers with FIELD=VALUE pairs.

SWMM5 Conversion Notes

When converting .xp → SWMM5 .inp, this tool generates: [JUNCTIONS], [OUTFALLS], [STORAGE], [CONDUITS], [ORIFICES], [WEIRS], [PUMPS], [XSECTIONS], [LOSSES], [INFLOWS], [COORDINATES], [MAP], [REPORT].

Key mappings: MaxDepth = ZTOP − GRELEV, Invert offsets = ZP1/ZP2 from C1, Outfall type = KO code (1→FREE, 2→FIXED, 3/4→TIDAL, 5/6→TIMESERIES), Shape = NKLASS (see table above), Roughness = Manning’s n from ROUGH field.

Historical Timeline

1971EPA SWMM Version 1 — Fortran, punch card input 1975SWMM Version 2 — enhanced routing 1981SWMM Version 3 — 80-column card format standardized 1988SWMM Version 4 — PC version, same card format ~1990XP Software creates XPSWMM — wraps SWMM3/4 in CAiCE database ~1995.xp format adds ZZZN/ZZZE GIS topology layer 2004EPA releases SWMM5 (complete rewrite, .inp format) 2010Innovyze acquires XP Software ~2012XPSWMM v12+ introduces new ZZZN format (name at col 11) 2021Autodesk acquires Innovyze 2026ArcMap discontinuation forces InfoSewer/InfoSWMM migration

The .xp format is a living fossil — 80-column punch card images from 1974, wrapped in a 1990s database engine, still in production use in 2026.

Test Coverage

This parser has been validated against 38 files ranging from 8 KB to 27 MB (19,288 nodes, 21,707 links total), including RTF-wrapped files, both ZZZN format generations, CR/LF/CRLF line endings, and models with conduits, orifices, weirs, pumps, storage nodes, and outfalls.