Hi,
I am looking for a way to Group the Lines in a file.. Basically My file structure is something like this
A 1 100 abc def
A 1 200 abc def
A 1 300 abc def
A 2 100 pqr def
A 2 200 pqr def
A 2 300 pqr def
A 1 100 abc def
A 1 200 xyz def
A 1 300 xyz def
I need it as shown below, Its Just to Group All 1s in the 2nd field
A 1 100 abc def
A 1 200 abc def
A 1 300 abc def
A 1 100 abc def
A 1 200 xyz def
A 1 300 xyz def
A 2 100 pqr def
A 2 200 pqr def
A 2 300 pqr def
It would be really great if you can tell me a logic to regroup and remove certain unwanted or duplicate record in the 2nd occurence.. If you see above you can find that "A 1 100 abc def " is repeated twice... I would neeed an output like this
A 1 100 abc def
A 1 200 abc def
A 1 300 abc def
A 1 200 xyz def
A 1 300 xyz def
A 2 100 pqr def
A 2 200 pqr def
A 2 300 pqr def
Let me know if someone has idea on these lines