Im looking for some understanding of FF logic
I have just made changes to a flat file schema to allow iteration to work properly. I have a potentially large structure where I may have multiple header in a file and an unlimited number of details that could quite easily take up all my available memory if loaded all at once. I want to ID the header and then read each detail one by one. Then start over when I see the next header.
I was constantly getting the first iteration correct, but each subsequent detail was putting the header of the next iteration as children of the details of the previous even though the header was clearly defined as a top level. The schema I was using worked perfectly converting the doctype into a string, but not in parsing it into values from a stream. The records are consistant in ending with a CRLF
My question is why is the below valid, or did I perform a lucky hack.
File structure
1-2-6-6…9–1-2-6-6…9 Etc where 1 records may repeat a dozen or more times and where there are an unlimited number of 6s each
The schema was:
1
2
6(unlimited)
9
My schema looks like this now:
1
2
6(single iteration)
9
6(unlimited)
This works perfectly, but I dont see why
Correct or hack? If its correct, whats the logic?