I have a unix file Err_Call_sipregtracking.csv as follows
colnum~filename~date~fieldnum~name~value
15~YYYYMMDD_BDACA_SELFRELATIVE_ARN~30MAR2016:00:00:00~1~BDA_CA_Code~1
15~YYYYMMDD_BDACA_SELFRELATIVE_ARN~30MAR2016:00:00:00~2~ARN_Code~2
15~YYYYMMDD_BDACA_SELFRELATIVE_ARN~30MAR2016:00:00:00~544~ALL~0
15~YYYYMMDD_BDACA_SELFRELATIVE_ARN~30MAR2016:00:00:00~544~ALL~0
Here delimeter is ~
.
I want distinct values of name column into a variable
My required output is:
'BDA_CA_Code','ARN_Code','ALL'
Please help me to achieve this.I tried with this
cat Err_Call_sipregtracking.csv | awk -F'~' '{print $5}' | uniq
Output is:
name
BDA_CA_Code
ARN_Code
ALL
But i don't want header in the result and I also want them in quotes and comma separated.