govindkailas has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a pipe delimited file having columns in different format. What would be the best way to validate it.
I am splitting the columns and taking it to variables. Now how should I validate each fields ? The max value of the column is specified in the bracket. Eg, column 3 is defined as varchar(5) , it should not go more than 5byte. if a field is failing for validation I need to write the failure notification to another file. Expected output would be something like beloweg) file.txt ------------- int|decimal(5,3)|varchar(5)|date|varchar(8)|decimal(14,3)... actual values 12|11.00|BILL|20130131|asd123q|1234.45|.. ... ... I
int|decimal field not in range|varchar(5)|date|varchar(8)|decimal(14,3 +)...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Efficient way to do field validation
by tobyink (Canon) on Jul 31, 2013 at 12:56 UTC | |
Re: Efficient way to do field validation
by ww (Archbishop) on Jul 31, 2013 at 12:42 UTC | |
by govindkailas (Acolyte) on Jul 31, 2013 at 14:00 UTC | |
by ww (Archbishop) on Jul 31, 2013 at 16:56 UTC | |
by govindkailas (Acolyte) on Aug 01, 2013 at 05:25 UTC | |
Re: Efficient way to do field validation
by Laurent_R (Canon) on Jul 31, 2013 at 22:37 UTC | |
by govindkailas (Acolyte) on Aug 01, 2013 at 05:20 UTC | |
Re: Efficient way to do field validation
by zork42 (Monk) on Jul 31, 2013 at 12:10 UTC | |
Re: Efficient way to do field validation
by sundialsvc4 (Abbot) on Aug 01, 2013 at 01:14 UTC |
Back to
Seekers of Perl Wisdom