I have a file with the following structure:
GO:0000001 mitochondrion inheritance
GO:0000002 mitochondrial genome maintenance
GO:0000003 reproduction
alt_id: GO:0019952
alt_id: GO:0050876
GO:0000005 obsolete ribosomal chaperone activity
GO:0000006 high-affinity zinc uptake transmembrane transporter activity
GO:0000007 low-affinity zinc ion transmembrane transporter activity
GO:0000008 obsolete thioredoxin
alt_id: GO:0000013
GO:0000009 alpha-1,6-mannosyltransferase activity
Where it says alt_id
it means that it is an alternative to the previous GO:
code.
I'd like to add to each alt_id
the definition of the previous GO:
, that is, I want an output like this:
GO:0000001 mitochondrion inheritance
GO:0000002 mitochondrial genome maintenance
GO:0000003 reproduction
alt_id: GO:0019952 reproduction
alt_id: GO:0050876 reproduction
GO:0000005 obsolete ribosomal chaperone activity
GO:0000006 high-affinity zinc uptake transmembrane transporter activity
GO:0000007 low-affinity zinc ion transmembrane transporter activity
GO:0000008 obsolete thioredoxin
alt_id: GO:0000013 obsolete thioredoxin
GO:0000009 alpha-1,6-mannosyltransferase activity
How can I copy the content of the previous row in the following? I work with Cygwin in a Windows-based environment.
GO:0000001
andmitochondrion inheritance
?