Hi All,
I got a file with continous records written in a single line and there is no space or any other delimeter, but I need to read the data and split the records according to the Length and then need to populate each and every column.
Format of the File is as follows
HEADERRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDDETAILRECORDTRAILERRECORD
Thanks in Advance
How to read Continous Records, No delimeter
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
All you need is no Record Delimiter property, and Record Length = Fixed on the Format tab (and, by implication, First Line is Column Names = False on the Properties tab).
When importing the table definition for the Sequential File, you specify that it is fixed width format, and the width of each column in the record. Once the table definition has been imported, click the Sync Parallel button.
Those things having been done, the Sequential File stage will be able to read your file.
When importing the table definition for the Sequential File, you specify that it is fixed width format, and the width of each column in the record. Once the table definition has been imported, click the Sync Parallel button.
Those things having been done, the Sequential File stage will be able to read your file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You said the file is fixed record width. Now you say it isn't. The solution is different - you will need to pre-process the file, reading it a block of bytes (or even a character) at a time, to produce a line-terminated file in the second case. If you're good with sed or awk you could use those; you could also use a Routine activity in a job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.