I want to print the countries which which have to
after ~:
.
welcome~:to~:Germany
welcome~:no please~:Italy
welcome~:to~:Brazil
welcome~:not ok~:China
Note: I do not know what will be there other than "to
". It can be anything and can be changed (like no please
, not ok
).
I am tried using cut, awk, sed. But I am unable to figure out.
awk -F "~:" '{print $2 $NF}'
But I get output like:
toGermany
no pleaseItaly
toBrazil
not okChina
How to filter countries other than to
.
UPDATE:
Alternative solution:(Figured out with cut) :-)
grep -v "to" |cut -d ':' -f3