title: A shell script to validate a column
body: <p>I have this script that is going to read in csv files that will be in directory. However I want the script to validate an entire coulmn of the .csv file before it moves to the second column i.e</p>
  
  <pre><code>Name, City
  Joe, Orlando
  Sam, Copper Town
  Mike, Atlanta
  </code></pre>
  
  <p>So it has to check the coulmn NAMES first before it moveds on to check City? How would i make changes to the following script to cater to this?</p>
  
  <pre><code>       # Read all files.  no file have spaces in their names
    for file in /source/*.csv ; do
           # init two variables before processing a new file
    FILESTATUS=GOOD
    FIRSTROW=true
         # process file 1 line a time, splitting the line by the 
         # Internal Field Sep ,
    cat "${file}" | while IFS=, read field1 field2; do
         # Skip first line, the header row
    if [ "${FIRSTROW}" = "true" ]; then
       FIRSTROW=FALSE
          # skip processing of this line, continue with next record
       continue;
    fi
  
          #different validations
    if [[ "${field1}" = somestringprefix*  ]]; then
       ${FILESTATUS}=BAD
       # Stop inner loop
       break
    fi
    somecheckonField2
    done
      if [ ${FILESTATUS} = "GOOD" ] ; then
        mv ${file} /source/good
      else
        mv ${file} /source/bad
      fi
   done
  </code></pre>