At the end of a variable-length field, there must be an FNC1 character that is not filled to the maximum; so FNC1 will appear between G3 and 21 .
FNC1 is invisible to humans, but can be detected by scanners and will be played in the line reported by the scanner. Just send the line directly to the text file and view the text with a hexadecimal reader. FNC1 should be obvious.
If possible, it might be an idea to swap the sequence of field 21 and field 10 , since you are using a pure digit for 21 . This would make the barcode a bit shorter.
Magoo source share