I need to read a text file and later save it to the database, where values are named in records of type:
01 : $ cnpj = Position 03 to 16, $ number = Position 17 to 16
02 : $ CodeBarras = Position 29 to 35
03 : $ Quantity = Position 03 to 16
Since the 02 record can have more than one row, it can handle items in an order.
The attached image demonstrates the layout of the file to be read: