Yashwant Palkar wrote:Let me state my requirement once again….
We have Counter File which contains following details for each record types.
Struture : RecordType|RecordCount|FieldCount
Example
1|27|9 –Means 27 records of record type 1, and each record has 9 fields
2|34|5 –Means 34 records of record type 2, and each record has 5 fields
We have Data File which contain actual records ordered by record type. Frist field of reach record contains value of Record Type.
Examplehad
1|field1| field2| field3| field4| field5| field6| field7| field8| field9|
1|field1| field2| field3| field4| field5| field6| field7| field8| field9|
1|field1| field2| field3| field4| field5| field6| field7| field8| field9|
.
.
.
Like total 27 records
2|field1| field2| field3| field4| field5|
2|field1| field2| field3| field4| field5|
2|field1| field2| field3| field4| field5|
.
.
.
Like total 34 records
We want to validate Data File against details present in Counter File. More spesifically we want to vaklidate following two things
(1) Number of records per Record Type
(2) Number of fields for each Record Type
Once more we are presented with creeping requirements. So you validate the CSV file against a file defining what should be in the file. Then, as has been said twice before, using one of the CSV libraries to read the CSV file. You can then read the definition file to see what should have been in your CSV file and make sure it matches.
I'm a little lost as to why you are having trouble with this.