In 4 th column I have values like (harsha-eircom, sarath-eircom) in printing I have to skip"-eircom".and if any field or value is null print "null". I tried like this, but not getting exact output, can u help me out.
a=$(awk -f "\"*, \"*" '{print$4}' sample. csv)
echo "$a"
b=$(cut -d '-' -f1 <<< "$a")
#echo "$b"
for a in $b
do
If [-z "$b"]
then
echo "value is null"
else
echo "$a"
fi
done