Here is my best (clumsy) attempt to date:
First step (not awk!) I sort all the types by time using
>for i in type1 type2 type3 type4 type5 type6
>do
>grep -e time -e type source_text >> source_text_sorted
>done
This gives me source_text_sorted:
timestamp1
type1 a
type1 b
type1 c
timestamp1...
Awk newbie:
My input file gathers data as a list:
timestamp1
type1 a
type1 b
type1 c
type2 d
type2 e
type4 g
type5 h
type5 i
type5 j
type5 k
type5 l
timestamp2
type2 d
type2 e
type3 a
type3 b
type3 c
type4 g
type5 h
type5 i
type5 j
type5 k
type5 l
timestamp3
type2 d
type2 e
type3 a
type3 b...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.