Hello Ubuntu Folks
I am looking to edit a text file using sed or whatever method works to make the following changes:
Original:
Code:
Chromosome ena CDS 153 1535 . + 0 transcript_name "transcript:AAS13770"; gene_id "gene:WD_0001"; gene_name "dnaA";
Chromosome ena exon 3028 3115 . + . transcript_name "transcript:WD_tRNA-Leu-1-1"; gene_id "gene:WD_tRNA-Leu-1"; gene_name "WD_tRNA-Leu-1";
New:
Code:
Chromosome ena CDS 153 1535 . + 0 transcript_id "transcript:AAS13770"; transcript_name "transcript:AAS13770"; gene_id "gene:WD_0001"; gene_name "dnaA";
Chromosome ena exon 3028 3115 . + . transcript id transcript:WD_tRNA-Leu-1-1"; transcript_name "transcript:WD_tRNA-Leu-1-1"; gene_id "gene:WD_tRNA-Leu-1"; gene_name "WD_tRNA-Leu-1";
Essentially I would like to take the transcript_name ("transcript:AAS13770"), add a new field before with transcript_id and paste the transcript name after this ending with a semi colon and continue this for every line.
Does anyone have any idea how to do this? I'm looking at sed but I cannot get my head around it. sorry to be a pain.
Best wishes,
Lewis
Bookmarks