ReqIF2Excel

ReqIF2Excel — user guide

1. What the tool does

ReqIF2Excel reads a .reqif or .reqifz file exported from a requirements-management tool and writes an Excel workbook. Its guiding rule is that nothing may be lost: every picture, OLE object and attached file that a requirement refers to is kept, shown, saved and traced back to the requirement that owns it.

2. Converting a file

With the window

  1. Start ReqIF2Excel.exe (or run_gui.bat when you work from the source).
  2. ReqIF file — pick the .reqif or .reqifz to convert.
  3. Excel output — pre-filled next to the input; change it if you like.
  4. Set the options (see §4), then press Convert.
  5. The log appears in the black panel. When it says Done, use Open workbook and Open attachments folder.

Your choices are remembered for the next session, in .reqif2excel.json in your home folder.

From the command line

python reqif2excel.py INPUT.reqifz [--out OUTPUT.xlsx] [options]
ReqIF2Excel.exe INPUT.reqifz --out OUTPUT.xlsx        (the .exe accepts the same options)
Option Effect
--out PATH Where the workbook goes. Default: next to the input, same name, .xlsx
--config PATH A JSON options file (see §5)
--no-embed / --embed Do not / do put pictures inside the workbook (the positive form overrules an options file that switches embedding off)
--no-extract / --extract Do not / do save the attachment files to disk
--keep-xhtml Add a column holding the raw XHTML of every rich-text attribute
--one-sheet Put all requirements on a single sheet instead of one sheet per specification
--max-image-height PX Scale embedded pictures to at most this height (16–1200)
--strict Exit with code 2 when any attachment is missing from the input
--quiet Print only the path of the workbook

Exit codes: 0 success, 1 a usage or input error (the message starts with ERROR:), 2 only with --strict, when attachments are missing.

When --config is not given, the command line uses reqif2excel_config.json next to the application if that file exists, exactly like the window does, and prints which file it used. The converter refuses to write the workbook over the ReqIF file it is reading.

The Windows .exe has no console, so when you drive it from a script it writes its log to ReqIF2Excel_last_run.log in the output folder and still returns the exit code above.

3. Reading the result

The requirement sheets

One sheet per ReqIF specification (a DOORS module, a Codebeamer document), named after it. Requirements appear in document order.

Column Meaning
# Row number within the sheet
Outline Position in the document tree: 1, 1.1, 1.2.1 …
Level Depth in the tree (1 = top). Excel row grouping follows it
Parent ReqIF ID The parent requirement in the tree
ReqIF ID The requirement’s ReqIF IDENTIFIER (stable, tool-generated)
Foreign ID The human id from the source tool (DOORS absolute number, Codebeamer item id)
Type The requirement’s ReqIF type (Requirement, Heading, …)
Table row yes when the row is part of a DOORS table (IS-TABLE-INTERNAL)
Name The object’s LONG-NAME
(attribute columns) One column per attribute found in that specification
Images Where the pictures of that requirement are anchored
Attachments One line per attached file: marker, state, saved file name
Links out / Links in Outgoing and incoming relations
Last change The LAST-CHANGE stamp of the object
Specification / Source file Which specification and which .reqif the row came from

Attribute columns that hold no value on any row are hidden, not removed: a module often declares far more attributes than its objects use, and those columns would otherwise bury the ones that matter. The Summary sheet lists every hidden column; to see one, select the columns on either side and choose Unhide. Set hide_empty_columns to false to keep them all visible.

How the requirement text is rendered

Rich text is flattened to plain text that keeps its structure:

In the source In the cell  
Paragraphs, line breaks One line each  
Bulleted and numbered lists - item / 1. item, nested lists indented four spaces per level  
Indentation (IBM DOORS writes it as nested block quotes) Four spaces per level  
Tables One row per line, cells separated by ` ; several paragraphs inside one cell are joined by / `
Links text (address)  
Code blocks Kept verbatim, indentation included  
Pictures and attached files A marker at their exact position, see §4  

The other sheets

4. Images and attachments — how the trace works

Every embedded item gets a marker inside the requirement text, at the exact place it occupied in the original:

Marker Meaning
[IMG 1: diagram.png] Picture number 1 of this requirement
[ATT 2: layout.ole] A file that is not a picture (OLE object, PDF, spreadsheet …)
[IMG 2.1: preview.png] The preview image that sits inside attachment 2 (a DOORS OLE object carries one)
[IMG 3 MISSING: photo.png] The requirement refers to this file but the input does not contain it

The numbering restarts at 1 for each requirement, and follows reading order.

The same items are listed in the row’s Attachments column and, in full detail, on the Attachments sheet: marker, kind, owning requirement (ReqIF id and foreign id), sheet and row, source attribute, original name, MIME type, size, SHA-256, the saved file (clickable), whether it is shown in the sheet, which attachment it is a preview of, the alternative text, and a note explaining anything unusual.

Files are saved next to the workbook in a folder named after it, for example requirements.xlsx → requirements_files/. Names are deterministic: <foreign id>_<marker number>_<original name>. Two references to identical bytes share one file.

Converting again into the same workbook name rewrites that folder: files that the previous conversion wrote and this one did not are removed, so the folder can never mix two documents. Only files this tool recorded itself are deleted. Anything else you put in the folder is left alone and reported as a warning.

A file that is present in the ReqIF archive but that no requirement points at is extracted too, and listed on the Attachments sheet as unreferenced with a warning. A file that a requirement points at only by name (its path did not resolve) is used, and the warning tells you so, because it might be another requirement’s picture.

Extracted files are written byte for byte as they were stored in the ReqIF archive: the tool never re-encodes, resizes or reshapes a file. The picture placed in the sheet is a scaled view of it that keeps the file’s own proportions; the full-size file is always the one in the folder.

Formats that Excel can show (PNG, JPEG, GIF, BMP, TIFF, WebP) are placed on the row. When an embedded object is itself a picture that also carries a preview image (IBM DOORS exports a BMP together with a PNG preview of it), only the picture is shown, so it does not appear twice; the preview is still saved and listed, with a note saying why it is not shown. Formats it cannot show (SVG, EMF/WMF, OLE containers, PDF, Office documents) are saved and linked from the Images cell instead, and the Attachments sheet says Embedded in sheet? = no. Either way the file is on disk and traceable.

Important — pictures float, they are not cell contents. Excel anchors a picture to a position, not to a row’s data. If you sort or filter the sheet, the pictures stay where they are and no longer line up with their requirements. The authoritative trace is the marker in the text plus the Attachments sheet, which survive any sorting. Sort a copy, or convert with --no-embed when you plan to sort.

The _files folder must travel with the workbook: the links in the workbook are relative to it. Zip the two together when you send them.

5. The options file

reqif2excel_config.json sits next to the application and is created with the defaults on first use. Edit it with any text editor.

Option Default Meaning
embed_images true Show pictures on the requirement’s row
extract_files true Save every attachment into the _files folder
max_image_height_px 200 Scale embedded pictures down to this height
max_image_width_px 400 …and this width (aspect ratio kept; the full-size file is always on disk)
keep_xhtml false Add a raw-XHTML column per rich-text attribute
one_sheet_per_specification true One sheet per specification, otherwise a single Requirements sheet
include_orphans true Export requirements that are in no hierarchy
apply_defaults true Fill an absent attribute with its DEFAULT-VALUE
id_attribute_preference ["ReqIF.ForeignID", "ID", "Item ID", "Identifier", "Key"] Which attribute becomes the Foreign ID column, in order of preference
name_attribute_preference ["ReqIF.Name", "Name", "ReqIF.ChapterName", "Summary", "Title", "ReqIF.Prefix"] Which attribute fills the Name column when the object itself has no name (Codebeamer and DOORS Next often leave it empty)
column_order ["ReqIF.ChapterName", "ReqIF.Text", "ReqIF.ForeignID"] Attributes to place first; the rest follow in the order the source tool declares them
hide_empty_columns true Hide attribute columns that have no value on any row (they stay in the workbook and are listed on the Summary sheet)

An unknown option is ignored with a note; an out-of-range or wrongly typed one stops the run with a clear message.

6. What the warnings mean

Message What happened What to do
attachment '…' could not be resolved A requirement points at a file the export does not contain Ask for a complete export; the text still shows a MISSING marker
hierarchy node … points at missing SPEC-OBJECT The document tree references a requirement that is absent A placeholder row keeps the position; the export is incomplete
n SPEC-OBJECT(s) belong to no specification hierarchy Requirements exist outside any document They are on the Unplaced objects sheet
n file(s) in the input are not referenced by any requirement The archive carries extra files They were extracted and marked unreferenced
exceeds Excel's 32,767-character cell limit A requirement text is longer than a cell The full text is on the Overflow sheet
attribute definition … is not declared in SPEC-TYPES The export is internally inconsistent The value is kept under its raw id, nothing is lost
enumeration value … is not defined A choice value has no declaration The raw id is written instead of the label
'…' cannot be displayed inside Excel Excel cannot render that image format The file is saved and linked instead
did not resolve to that path The file was found by name, not by the path in the requirement Check on the Attachments sheet that it is the intended file
the value is a X but its definition says Y The export contradicts itself The value is read as what it actually is, so nothing is lost
SPEC-OBJECT … exists in both … Two documents in the archive reuse one identifier Each document’s own copy is exported; links between documents may be ambiguous
attribute definition … is declared differently Two documents give one identifier different names or types Each document keeps its own column and type
carries N values for one attribute definition A malformed export repeats a value All of them are written into the cell
already contains text shaped like an attachment marker The requirement text itself contains [IMG 1: …] The Attachments sheet lists the real ones
file(s) in the attachments folder were not written by this conversion Something else is in the folder Move it out, or use a fresh output name
the export points this embedded object at '…', the file an earlier object of the same requirement already uses A known IBM DOORS export defect: when one object embeds several drawings of the same kind, DOORS can write the first drawing’s file name into every one of them, and leave the correct file unreferenced in the archive Nothing: the orphaned file was matched to the drawing it belongs to, and the Attachments sheet notes the repair. It is only done when that file is referenced by nothing else
attribute column(s) have no value on any row and were hidden The module declares attributes its objects never use Nothing; unhide them in Excel if you need them

7. Limits

8. About and where the tool comes from

The window’s About button shows the version, what the converter guarantees, and the project page. The address can be selected and copied there, and Open in browser opens it directly.

   
Project page https://cosmindxu.github.io/reqif2excel/
Version reqif2excel.py --version, and the Converter row on every workbook’s Summary sheet

Every workbook records the converter version and the project page on its Summary sheet, so a workbook that circulates for months can still be traced back to the build that made it, and whoever receives it knows where the tool lives.