Would some kind soul please advice me or help me out with this flat file? I do not know how to achieve what I want.
As you can see below there are a few fields which can be used as tag identifiers.
We have 'S' for the start tag, 'I' for customer information, 'F' for invoice details, 'N' for the note section and lastly 'E' for the end section. As you can see there are repeating records as well and this mix of nesting and the use of positional records is giving me trouble. So, every F-section (customer) has its own set of repeating invoice with note.
I did try the tips on this wonderful post but in this issue no nesting exists unfortunately.
The strange thing is that I can manage to get what I want if I do not take into consideration the positional records. If I just take the entire data and put it into one field (i.e. entire F without positioning) I can get the structure right and that includes the repeating. But they are positional, I, F and N and all my struggle always yields in an error either stating that it is looking for a tag identifier letter or that it is looking for a carriage return and end of line. Any help would be greatly appreciated as I have been struggling with this for quite a while now.
Sample file:
S
I02710242Company name 01 Postboks 123 Sum 010223 14 15 50 54 9597598396200468 NO N
F141220178065428 00000102700-13012018000000080654288
NINK !!!!!!!!!!!
F141220178065429 00000197200-13012018000000080654296
NINK !!!!!!!!!!!
I02710242Company name 02 Postboks 234 Seum 010223 14 16 50 54 9597598396200468 NO N
F050120185794526 00003686250+04022018000000057945263
NINK !!!!!!!!!!!
F141220178065428 00000102700-13012018000000080654288
NINK !!!!!!!!!!!
F141220178065429 00000197200-13012018000000080654296
NINK !!!!!!!!!!!
E000000420000005000030679668+
So what I think I would like to achieve (unless any of you have a better setup) is a schema that looks like this:
S
---I
-F
-N
-F
-N
-I
-F
-N
-F
-N
E