You seem to be reluctant to post much detail. . . For us to be able to actually help, we really do need a complete explanaton of what you have and what you want to do with it.
Examples (with more than 2-digits of detail) will help explain your requirement. . . You do not need to post all of the detail from all of the record types, but you do need to post enough for someone to understand your requirement.
Keep in mind that while your question is completely clear to you, it will probably not be so clear to others who read it.
on the end I should make a printing file that prints these data.
What is this? Who/what are "these data"?
I have an array or a record set. . .
I need to read all the array
Is there a set of records or is there an array (both?)? How is the array built? How many "sets" of data might there be in the input?
and then to print out a file with everything written in certain rows.
Show how this should be output.
When you post sufficient detail, we will try to suggest ways to get what you need from a process.