My input file has the first seven bytes as the sort tag. I need a sort that would give me two output files - One with unique records with the first seven bytes and the count of such records. The second should be the same as my input file with the first seven bytes removed. Is it possible to write such a Sort?
My input file:
ABCDEFG jkhfjdkhmhgjldhglkdgh
ACDFGRE ljglkrgjrklgjrklgjrklgjkl
BFGRSFF dgdgdkglrgmlgmlglgklkl
ABCDEFG jfkfjkjlmhnfdjknfhssjs
ASDFREG jklejf agfwdhdsbndmfj
ACDFGRE hwitbbcvmznhyurhwin
My output files should be:
Output 1:
ABCDEFG 2
ACDFGRE 2
ASDFREG 1
BFGRSFF 1
Output 2: This can be sorted or may be written in the same order as in the input file.
jkhfjdkhmhgjldhglkdgh
ljglkrgjrklgjrklgjrklgjkl
dgdgdkglrgmlgmlglgklkl
jfkfjkjlmhnfdjknfhssjs
jklejf agfwdhdsbndmfj
hwitbbcvmznhyurhwin
Thanks in advance,
Laksh