I certainly do wanna take a look at it, probably just a small thing.
but the email dos something with your indentation.
can you attach the mapping script to your eami.
(as it is easter, I only will be able to answer late tonight ;-)
henk-jan
Hi Henk-Jan,
Thanks for your prompt reply - especially over Easter!
I attach the test input file, in and out Grammar files and two mapping script attempts:
- csvDIRDEB_edi2edi_Gives1stLevelBOnly.py gives me 6 records (required amount) but only uses the first LIN+1 value for the DTM+203
- csvDIRDEB_edi2edi_Gives18Records.py gives me 3 LIN * 3 LIN * 2 SEQ = 18 records but does scan the LIN tree for the values – so I know they are there -just too many times!
How to get the best of both?
Thanks for your help!
riverthames
Hi Jeff,
I think csvDIRDEB_edi2edi_Gives18Records.py is the right approach but
you have to change:
for lin in inn.getloop({'BOTSID':'UNH'},{'BOTSID':'LIN'}):
for sin in
inn.getloop({'BOTSID':'UNH'},{'BOTSID':'LIN'},{'BOTSID':'SEQ'}):
to:
for lin in inn.getloop({'BOTSID':'UNH'},{'BOTSID':'LIN'}):
for sin in lin.getloop({'BOTSID':'LIN'},{'BOTSID':'SEQ'}):
(Currently, for each LIN you're looping over every SEQ in the file,
instead of every SEQ of the current LIN..)
A short test with this modification resulted in the attached .csv,
I think it looks ok, right?
greetings from Austria
Thomas