I'm trying to extract some information from a very huge document. The file follows this pattern:
'>Title 1'
0 200, >name [numbers&letters]
1 200, >name [numbers&letters]
2 200, >name [numbers&letters]
'>Title 2'
0 200, >name [numbers&letters]
1 200, >name [numbers&letters]
...
'>Title 600.000'
For each group of lines between Title
, I need to print 3 tab-separated columns
- the number of lines between each
Title
- the
name
- the number on the 2nd column of the first line in the group (first lines always starts with
0
) – in the example the number is200
I'm trying with Bash and awk/sed, but I'm not able to define a kind of loop for this task. Any ideas?