[SlugBug] data formatting query

Bill Best bill.best at commedia.org.uk
Thu Dec 8 19:35:12 GMT 2005


hi

[thanks to Chris J and Bruno for the Apache advice yesterday]

this is a quick and easy one - i have a large text file of data in this 
sort of format:

> Date: 081205 Code: 3  Origin: R0E306 Seq No: X38Z Operator: 1123 Ext:
>                                                                             
> Date: 081205 Code: 5  Origin: R0E306 Seq No: W>0K Operator:      Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V>WW Operator: IGNO Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V=:V Operator: 1815 Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V=:V Operator: 1815 Ext:
>                                                                      
> Date: 061205 Code: 9  Origin: R0E306 Seq No: V812 Operator:      Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V811 Operator: IGNO Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V6BZ Operator: 2149 Ext:
>                                                                      
> Date: 061205 Code: 3  Origin: R0E306 Seq No: V6BZ Operator: 2149 Ext:
>                                                                      
> Date: 051205 Code: 5  Origin: R0E306 Seq No: UOX= Operator:      Ext:          

i would like to chop off all but the first two columns, remove the blank 
lines and then do a unique sort - so from the above i would end up with:

> Date: 051205
> Date: 061205
> Date: 081205

i've forgotten what combination of commands will do this for me except 
for adding "sort -u" at the end.

please advise and many thanks in advance.

bill best


More information about the SlugBug mailing list