How to process Variable Length File
Posted: Mon Jul 15, 2013 5:49 am
Hi,
I have a requirement to read the variable length file (ASCII - having packed decimals in each record type) which does not have any record delimiter.
There are different types of records present in file and all they have different length. Each record has 2 byte field (RDW) which has record length and after this field it has entire record of that length plus some offset at the end of record to make entire record length multiple of 4.
e.g. [RDW(2 byte field)=12][12 byte record][2 byte padding]
since record length including RDW is 14 byte so there is padding of 2 byte to make it multiple of 4 byte.
Could any one help me to suggest how to read this file. Can I read this file using CFF stage or I need to write some program to read it.
I have gone through different topics in this forum but did not get answer I am looking for. In case I missed any post giving solution of this please let me know the link.
Thanks,
Rohit
I have a requirement to read the variable length file (ASCII - having packed decimals in each record type) which does not have any record delimiter.
There are different types of records present in file and all they have different length. Each record has 2 byte field (RDW) which has record length and after this field it has entire record of that length plus some offset at the end of record to make entire record length multiple of 4.
e.g. [RDW(2 byte field)=12][12 byte record][2 byte padding]
since record length including RDW is 14 byte so there is padding of 2 byte to make it multiple of 4 byte.
Could any one help me to suggest how to read this file. Can I read this file using CFF stage or I need to write some program to read it.
I have gone through different topics in this forum but did not get answer I am looking for. In case I missed any post giving solution of this please let me know the link.
Thanks,
Rohit