I'm using the data interator to input a file. The file is comma seperated. The fields are "Name", "ID", "Email","Company", etc.
I have four variables, varName, varID, varEmail, varCompany
What I want to do is simply loot is through the file and assign each of the fields to its corresponding variable in an assignment node that is nested within the data iterator loop. I do not want to have to read the whole line into one variable and then use code to parse the line into its fields. The problem is that it reads one field at a time and I never know which field it has read so I can't; hterefore ; selective branch or determine easily which variable it has read so that I can assign it appropriately.
Would anyone be able to post a quick example flow that achieves what I am attempting to accomplish? I think I'm missing something obvious. I've looked at the user guide and reference materials, and they don't really address what i'm looking to accomplish.
Thanks
Brian
Brian, you need to use 2 data iterators: one to parse the file and one to parse the record:
I’m struggling with how to assign these data elements and would appreciate just a little more clarification. I’m popping in 3 screenshots. The first is iterator #1, the second is iterator #2, and the third is the assignment tab. Given what you see can you please advise how exactly I need to specify the field? I’ve tried a bunch of stuff and keep getting errors. Thanks again
Thank you AGAIN John. I’ll give it a shot!
[script removed]
Has anyone used the data iterator with a flat file that is fixed length and each line has different lengths? I have a file for example that has the following:
ER01 - length of 3221
ER02 - length of 6128
ER03 - length of 265
ER05 - 861
The ER01 record is the header record for each person's expenses, the ER02 is the detailed line of each person's expenses. There is nothing to correlate ER01 with ER02 records....right now we have this being done via Cobol and it reads in the ER01 header then all ER02 records following that ER01 and resets at the next ER01 record for the next set of ER02 records. I have been able to get (using data iterator) all the ER01 data and ER02 data into corresponding tables, but now have no way to correlate the header records to the detail records.
I need to get this data written into IPA as lawson/infor is moving away from cobol.
Posted By cpaine216 on 07/30/2018 1:26 PM Has anyone used the data iterator with a flat file that is fixed length and each line has different lengths? I have a file for example that has the following: ER01 - length of 3221 ER02 - length of 6128 ER03 - length of 265 ER05 - 861 The ER01 record is the header record for each person's expenses, the ER02 is the detailed line of each person's expenses. There is nothing to correlate ER01 with ER02 records....right now we have this being done via Cobol and it reads in the ER01 header then all ER02 records following that ER01 and resets at the next ER01 record for the next set of ER02 records. I have been able to get (using data iterator) all the ER01 data and ER02 data into corresponding tables, but now have no way to correlate the header records to the detail records. I need to get this data written into IPA as lawson/infor is moving away from cobol.
I do not have one specifically like this but I have one that has to evaluate each line and determine what to do based on data in the line and the output is not the same each time so it does a similar evaluation and cannot rely on standard delimiter.