Am new to perl language , would really help if some of you assist me how to use a regex say for example this is my log file
000046571|1000025|CUSTOMER|27-JUN-2007 06:27:59|005|DEFAULT
000046572|1000026|ACTIVATE|16-JUL-2007 12:33:13|013|DEFAULT
000046572|1000026|ACTIVATE|16-JUL-2007 12:33:13|018|MENU
i want to take only the 6th field(DEFAULT) by using my following perl srcipt
cut -d \| -f6 <filename> | sort | uniq
so that i take only the unique fields(DEFAULT, MENU. etc.) from the log file.
When i run the above command i get duplicate fields also which should not be the case.I guess at the end of every row there is a space so am not able to take unique fields.
Reallly apprecaite if anyof you could help me from this?