Split features from OGR/GMT file into separate files

Added by Andreas 3 months ago

Say I have an OGR/GMT file, e.g.

>
3 45
4 46
5 47
>
3 76
2 65
1 65
>
3 87
1 67
3 67

and I would like to split this into one file per feature. In the case above, this would result in three files:

file1.gmt

>
3 45
4 46
5 47

file2.gmt

>
3 76
2 65
1 65

file3.gmt

>
3 87
1 67
3 67

What would be the best way to do this? I was seeking help from gmt select but I could not find any.