0

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
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.