I have an text file with below input, I need to validate the input in ruby whether it is correct format or not?
Need to read an each line of text file and validate that whether the input is matching to Integer,s1-integer,s2-integer,s3-integer,s4-integer format other wise I need to raise an error that file input format is mismatch.
The input line is not limited to 5, it can be any number of lines.
Integer,s1-integer,s2-integer,s3-integer,s4-integer
Example inputs:
1,S1-88,S2-53,S3-69,S4-64
2,S1-92,S2-86,S3-93,S4-77
3,S1-53,S2-59,S3-72,S4-59
4,S1-60,S2-52,S3-85,S4-62
5,S1-85,S2-53,S3-74,S4-61