Hi I've got a file with about 20,000 records in the following lines (layout):
XXXXXXXXX||XXXXX|XXXXX
X means alpha-numeric chars
I want everything in XXXXXXXXX||, which is a kind of first(field),to be unique and output to a separate file.
I first did this with "sort file_name | uniq > new_file_name"
I believe this is an incorrect approach.
I then did this with "sort +0, -1, -u, -t "||" file_name > new_file_name"
I am still not convinced.
Is there any better approach? Thanks in advance
XXXXXXXXX||XXXXX|XXXXX
X means alpha-numeric chars
I want everything in XXXXXXXXX||, which is a kind of first(field),to be unique and output to a separate file.
I first did this with "sort file_name | uniq > new_file_name"
I believe this is an incorrect approach.
I then did this with "sort +0, -1, -u, -t "||" file_name > new_file_name"
I am still not convinced.
Is there any better approach? Thanks in advance