I have code that checks the contents of a variable that is created from parsing a csv file. however the code below isn't working.
$3 ~ ($2 == "\"[ABCDEFGUHIJKLMNOPQRSTUVWXYZ]\"" ? "^\"[[:digit:]]\"$" : "\"\"$") {
print "15th field invalid-OFFENCE FILE"
}
sample data below
"ABC","A","","a" --- # This should fail because of no data in field 3
"ABC","","","a" --- # This should pass because of no data in field 2 thus it should use the else statement of empty
"ABC","A","2","a" --- # This should pass because of data in field 2 and 3
however whats actually happening is the second sample that should pass is failing and I cant for the life of me work out why