Documentation
A lightweight tool for converting structured XML data into TXT files using a flexible configuration file.
The program reads an XML file and generates one or more TXT files
according to rules defined in config.ini.
The configuration file must be located in the same directory as the executable and saved in UTF-8 encoding.
Each section in config.ini generates one TXT output file.
[BusStops_Station]
Produces:
BusStops_Station.txt
The converter reads XML elements and formats them into TXT rows based on configuration rules.
[General] output_location = 1
Determines where the output folder is created.
| Value | Description |
|---|---|
| 0 | output folder next to input XML |
| 1 | output folder next to executable |
Standard mode means:
1 XML item = 1 output row
[BusStops_Station] section = BusStops item = BusStop key = Station fields = ID,"NameFull (ZoneID)","NameFull (ZoneID)"
| Parameter | Meaning |
|---|---|
| section | XML container element |
| item | repeating XML element |
| key | text before "=" in output |
| fields | output template |
Example output:
Station=123,"Main Street (1)","Main Street (1)"
Fields are separated by commas.
| Syntax | Meaning |
|---|---|
| ID | XML attribute or element value |
| "text" | constant text |
| empty | empty column |
| field@Item | reference to another XML element |
Examples:
fields = ID fields = ID,"NameFull" fields = ID,"NameFull (ID)" fields = SuperID@Zone,,ID@Zone
If elements are deeper in the XML hierarchy,
use the parent parameter.
parent = Tariffs/Tariff/PriceTable/Data
XML may contain multiple tables inside one structure.
Use group and separator.
group = PriceTable separator = ID@Tariffs/Tariff, Name@Tariffs/Tariff, Payment@Tariffs/Tariff/PriceTable
Example output:
1,City Tariff,Cash,QR Price=1,21.00,60 Price=2,25.00,90
Merge mode combines multiple XML records into one output row.
[Zones_MainZone] type = merge section = Zones item = Zone key = MainZone fields = SuperID@Zone,,ID@Zone;"Name@SuperZone" group_by = SuperID value = ID
Example output:
MainZone=10,,101,102,103;"Central"
config.inioutput directory