8 required_fields=(byr iyr eyr hgt hcl ecl pid)
11 while read -u 3 line; do
12 if [ "$line" = "" ]; then
18 cur_data="${cur_data}${seperator}$line"
22 # on the last line, if cur_data isn't empty, add that to the array
23 if [ "$cur_data" != "" ]; then
30 for field in ${required_fields[@]}; do
31 if ! [ ${kvp[$field]+a} ]; then
39 for (( i=0; i<${#data[@]}; i++ )); do
42 for field in $record; do
47 if ( verify_data kvp ); then
48 valid_count=$((valid_count+1))
53 echo "$valid_count valid entries"