0

I've got some problems when comparing two variables in my CSV

here's my code

#!/bin/bash
exec < /path/to/file/PARAM.csv || exit 1
read header # read (and ignore) the first line
while IFS=, read table column; do
    if [[ $column = "NULL" ]]; then
        echo "empty"
    else
        echo $column
    fi
done

in my file there are some fields that have "NULL" values, but the comparison isn't working, it always print the $column

Here is some example in my CSV :

MAIN_RPT_STD010,NULL
MAIN_RPT_STD030,NULL
MAIN_RPT_STD050,NULL
MAIN_RPT_STD070,NULL
MAIN_RPT_STD090,NULL
MAIN_ACTIVO,BUSS_DATE
MAIN_ACTUAL_SCORECARD,BUSS_DATE
afghifari
  • 27
  • 6

0 Answers0