S
Sandy
Hi
1. I have a flat file (.txt) which I need to parse . Basically file is
of size 146 and has 4 different types of records namely
C01,C10,C20,C30.
File contains one record reach of type C01 , C10 and multiple C20,C30
records.
Giving below sample records (each new line is new record)
C01121036200529400100000 0000000278
C10121036200529400100000 5500000001 010
2. Record structure of each record type is different.
3. I need to parse the .txt file,identify record type
4. Based on corresponding record structure apply validation rules
say , I extract c01 record
C01121036200529400100000 0000000278
then 121036 shows time
2005294 shows date (yyyyddd) (field type:char)
001 shows version number (field type:char)
000000 shows sequence number (field type:num)
00000 shows legacy system id
0000000278 shows no of records in file. (field type:num)
char type fields should be checked as not null or spaces
while number field should be checked whether they contains number
fields at all.
also need to check whether total number of records in file is equal to
32
5. Generate error report where data violates validation rules.
can anybody give me sample code or provide me way to do this
1. I have a flat file (.txt) which I need to parse . Basically file is
of size 146 and has 4 different types of records namely
C01,C10,C20,C30.
File contains one record reach of type C01 , C10 and multiple C20,C30
records.
Giving below sample records (each new line is new record)
C01121036200529400100000 0000000278
C10121036200529400100000 5500000001 010
2. Record structure of each record type is different.
3. I need to parse the .txt file,identify record type
4. Based on corresponding record structure apply validation rules
say , I extract c01 record
C01121036200529400100000 0000000278
then 121036 shows time
2005294 shows date (yyyyddd) (field type:char)
001 shows version number (field type:char)
000000 shows sequence number (field type:num)
00000 shows legacy system id
0000000278 shows no of records in file. (field type:num)
char type fields should be checked as not null or spaces
while number field should be checked whether they contains number
fields at all.
also need to check whether total number of records in file is equal to
32
5. Generate error report where data violates validation rules.
can anybody give me sample code or provide me way to do this