I am quite new to Linux. I have data like the following, it is in a tbl format
>Feature gnl|XXX|IFEJKLFI_79 locus_tag IFEJKLFI_05549 locus_tag IFEJKLFI_05549 protein_id gnl|XXX|IFEJKLFI_05549 >Feature gnl|XXX|IFEJKLFI_88 locus_tag IFEJKLFI_05553 locus_tag IFEJKLFI_05553 protein_id gnl|XXX|IFEJKLFI_05553
I want to extract locus_tag name and match it with the feature name. To elaborate more, I would like the output to look like that
Feature gnl|XXX|IFEJKLFI_79 IFEJKLFI_05549 Feature gnl|XXX|IFEJKLFI_88 IFEJKLFI_05553
Is that possible to use the awk command directly or should I manipulate the data first? And if yes, how to extract the data?
it is in a tbl format- the text you show doesn't look like the input to or the output from the Unix command tbl as far as I remember (but I haven't used it in about 15 years so I may be forgetting something), nor (if you're trying to save 2 chars by saying
table) does it look like tab-separated data, nor it is a visually aligned in tabular format.
>part of your file? Is that really the exact format you are dealing with? I ask because this looks like it should be a genbank flat file, which doesn't have
>and for which there are dedicated parsers.
IFEJKLFI_05549in your first record) allways the same within the same
Feature? That is important because if that is true it doesn't matter if we take it from line 2 or 3 (or 4, for that matter) of the
Featurerecord. If there can be different
locus_tags, which one should we take?