Click button to edit
Advanced: Multi Record Processing
Read or write a file with many different layouts
The idea of this engine is to parse files with different record types (this engine doesn't use any hierarchical structure like the master-details, all the records are in linear relation for it).
With the MultiRecordEngine you can parse also mixed delimited and fixed length records.
For example, you can parse this strange file:
Input.txt
This file contains three record types; Customers(begins with letters, | delimited), Orders(begin with numbers, ';' delimited) and the sample type of the first example.
Customer.cs
SampleType.cs
Orders.cs
To work with this engine you must create one instance of it in this way:
RunEngine.cs
This is the selector that determines the record type based on whatever criteria you write
Selector.cs
Console
Orders: 10248 - VINET - 32,38
Orders: 10249 - TOMSP - 11,61
Customer: ALFKI - Alfreds Futterkiste, Maria Anders
Customer: ANATR - Ana Trujillo Emparedados y helados, Ana Trujillo
Orders: 10250 - HANAR - 65,83
SampleType: 012 - 345
SampleType: 123 - 456
Orders: 10251 - VICTE - 41,34
SampleType: 901 - 234
SampleType: 234 - 567
Customer: ANTON - Antonio Moreno Taquería, Antonio Moreno
Customer: BERGS - Berglunds snabbköp, Christina Berglund