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
27 for (( i=0; i<${#data[@]}; i++ )); do
30 for field in $record; do
35 for field in ${required_fields[@]}; do
36 if ! [ ${kvp[$field]+a} ]; then
40 valid_count=$((valid_count+1))
44 echo "$valid_count valid entries"