I have tab delimited .txt files looking like this:
""
"5 um"
"Lipid droplet number"
"Lipid droplet diameter"
"Mito"
22
0
5 um
64 255 0 0
2
1615 2022
2037 2021
1
Lipid droplet number
64 255 0 0
1
583 1945
0
Lipid droplet diameter
64 255 0 0
2
1406 849
1364 882
0
Lipid droplet diameter
64 255 0 0
2
1105 1333
1082 1369
0
Lipid droplet diameter
64 255 0 0
2
619 1932
580 1953
0
I want to make a new .txt files including only the 2nd and 3rd row following all places with rowname "Lipid droplet diameter".
The result should be something like this: (I want to delete all other rows than with those with diameter info)
1406 849
1364 882
1105 1333
1082 1369
619 1932
580 1953
2 columns and 2 rows is ok. 4 columns and 1 row is also ok. This one is best for Excel I guess.
An ugly getline awk
A better version
Better table view:
Using sed:
Gives:
Another method:
For variable rows and columns, you could try this:
Example assuming the above is saved as
lipid.awk
: