@@ -40,6 +40,38 @@ $analyser->loadSegmentsXml('edifact/src/EDI/Mapping/d95b/segments.xml');
4040$text = $analyser->process($parsed, $segments);
4141```
4242
43+ EDI data reading from extracted group
44+ -------------------------------------
45+
46+ As not to have to go through the indexes for extracted groups, just set the group as ParsedFile of the reader.
47+
48+ E.g. inventory messages (snippet, not a valid EDI message!):
49+
50+ ```
51+ INV+2++1'QTY+156:1000:PCE'QTY+145:3000:PCE'LOC+18+YA:::567'DTM+179:20180509:102'RFF+AAK:TEST'DTM+171:20180509:102'
52+ INV+1++11'QTY+156:200:PCE'QTY+145:2800:PCE'LOC+18+YA:::567'DTM+179:20180509:102'RFF+ALO:4916165350'DTM+171:20180509:102'
53+ INV+1++11'QTY+156:200:PCE'QTY+145:2600:PCE'LOC+18+YA:::567'DTM+179:20180509:102'RFF+ALO:4916165351'DTM+171:20180509:102'
54+ INV+1++11'QTY+156:200:PCE'QTY+145:2400:PCE'LOC+18+YA:::567'DTM+179:20180509:102'RFF+ALO:4916165352'DTM+171:20180509:102'
55+ INV+1++11'QTY+156:100:PCE'QTY+145:2300:PCE'LOC+18+YA:::567'DTM+179:20180510:102'RFF+ALO:4916165359'DTM+171:20180510:102'
56+ ```
57+
58+ ``` php
59+ $reader = new EDI\Reader($fileName);
60+ $recordReader = EDI\Reader();
61+ $groups = $reader->groupsExtract('INV');
62+
63+ foreach ($groups as $record) {
64+ $recordReader->setParsedFile($record);
65+ $records[] = [
66+ 'storageLocation' => $recordReader->readEdiDataValue(['LOC', ['2.0' => 'YA']], 2, 3),
67+ 'bookingDate' => $recordReader->readEdiSegmentDTM(179),
68+ 'enteredOn' => $recordReader->readEdiSegmentDTM(171),
69+ 'quantity' => $r->readEdiDataValue(['QTY', ['1.0' => 156]], 1, 1),
70+ 'actualStock' => $r->readEdiDataValue(['QTY', ['1.0' => 145]], 1, 1)
71+ ];
72+ }
73+ ```
74+
4375Readable EDI file
4476-----------------
4577```
0 commit comments