Parse Flat File

I have a flat file with no record identifier.Looks like below. I need to parse it. I have defined a schema defn and when I do convertToValues, I get parse exceptions. “Found no valid records”.

1003,FM1002,2008-06-17-08.57.10.358449,2008-06-17-09.09.27.448956,3030,3051
1207,FM1001,2008-06-12-00.27.20.700642,2008-06-12-00.42.06.699415,4538,4565

Thanks

If no record identifier then did you set RecordDefinition as “recordWithNoID”?? and set its Properties “maxRepeat=unlimited” beneath this create you FieldDefinitions (1,2,3…) as the Nth option.

Also in your delimited option,did you set record delimiter = new line and field seperator (,) choosing the Nth field option??

Try with the above combinations to parse ff successfully and test it…This should work as expected…

HTH,
RMg

Yes I tried that but I still get the same error “found no valid records”. Any other suggestions?

Can you elaborate on your current schema definition details?? the above steps should work with the comma seperated delimited file…

I have created a Schema as per your recommendations.

RecordDefinition as “recordWithNoID”??
and set its Properties “maxRepeat=unlimited”
Created FieldDefinitions (1,2,3…) as the Nth option.

Also in your delimited option
record delimiter = new line
and field seperator (,) choosing the Nth field option and that is set to 0.

When i try to execute this schema with the flat file I have, it gives me an exception of “No valid records found”.

I cannot attach a screenshot but I can send you one f you like to see it.

Please let me know if you have any further questions

Thanks
Dhara

Did you start the FieldDefinitions from 0?? (0,1,2,3…) as the Nth option…try this out…

Yes tried that as well but it fails. Not sure what is going on.

You need to set the default record in the Schema.

Thanks! that worked.