HEAD 234626 fgsdhsh - 1-1,Ok to identify using HEAD
165484 ashrhsh - 1-1 no identifier, but I know how it will look like and its mandatory in the file.
123564 gsertse - 1-1 no identifier, but I know how it will look like and its mandatory in the file.
LINE AA BB CC - 1-many,Ok to identify using HEAD
The problem is that the second and third row do not have a identifier and I dont know how to use different recordWithNoID?
Yes different fieldd, but the thing is that second/third row do not use the same field structure, thats why I cannot use a recordWithNoID since you can only have one recordWithNoID that uses the same fields. Correct?
You are correct, In these type of structures you need handle some part of data throuh code.
Note: To handle through code, I would suggest to confirm file structure & proceed further and make sure use logic the logic correctly and also use iterator, if file is big
Can you please take 2-3 sample files and count the number of characters in 2 line and let us know?
If line2/3 is not of fixed length then you have to:
Split the file in 3 parts, 1. HEAD 2. Sandwiched data 3. LINE
HEAD and LINE are easy to handle as they have identifiers.
The tough job is to process Sandwiched data. You need to identify a pattern and come up with logic.
I think joh is giving sample of only two line, in case if he is getting more than 2 line. I would suggest to use iterator
We have handled these type of file(having two recordWithNOID structures) using iterator & through code, once developer have good understanding in pattern of data
Rankesh, I dont think its possible to do it your way since the structure of row 2 and 3 are different and the record delimiter is newline. HEAD, LINE and TOTAL are easy to handle I agree.
I have written a crude code, which is not for production use. You need to modify and use ffiterator, if required. Please take help of attached code and improvised over it.
HTH.
Hi Sai,
Please add your inputs to improve the attached code.