My file looks something like this:
>Cluster 0
0 58aa, >5XX8A... at 91.38%
1 58aa, >3LDMA... at 100.00%
2 58aa, >3BTHI... at 96.55%
3 65aa, >1F7ZI... *
4 58aa, >3LDJA... at 100.00%
>Cluster 1
0 57aa, >1ZJDB... at 94.74%
1 58aa, >1AAPA... at 91.38%
2 56aa, >5NX1D... at 92.86%
>Cluster 2
0 60aa, >4ISLB... at 98.33%
1 62aa, >4ISNB... at 95.16%
>Cluster 3
0 59aa, >3BYBA... *
1 59aa, >5ZJ3A... at 100.00%
2 59aa, >3UIRC... at 100.00%
3 57aa, >3D65I... at 100.00%
How can I use sed or awk to get the IDs after > (for example: 5XX8A) in between the ">Cluster" ones. I want to be able to save them separately (in different files). One file per cluster. Or something more parsable like a single file with the IDs right next to the cluster number.
As a first approach doing something like:
sed -n '/^\>/,/^\>/p' filename
returns the whole file :/