I have a large (potentially up to 1Mb) text file which I need to split before translating segments and writing results to Excel.
The first problem is that the file is one long line - ie there are no CrLf characters.
The second problem is that the data segments are delimited by multiple characters such as LIN, ATT, DTM.
The third problem is that the file also contains a header and trailer sections which are in similar formats.
In the attached sample file, I want to obtain the following result (pipes shown to delimit cells):
As you can see, there is an added complication that not all values are guaranteed to be present, but information needs to be created whether a piece of information is present or not.
I would prefer to use VB6, as I already have the ftp code required to retrieve the file in that, but it could be in VB.NET 2008.
(For those interested, the format is EDIFACT as specified by the UK Inland Revenue.)