Aspas duplas em uma coluna específica usando awk ou sed

0

Eu tenho esta entrada:

##gff-version 3
chr1    TAIR10  mRNA    3631    5899    .   +   .   ID AT1G01010.1 ;geneID AT1G01010 ;gene_name AT1G01010
chr1    TAIR10  exon    3631    3913    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    3996    4276    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    4486    4605    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    4706    5095    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    5174    5326    .   +   .   Parent AT1G01010.1
chr1    TAIR10  exon    5439    5899    .   +   .   Parent AT1G01010.1

Eu quero que o ID, o geneID e o gene_name tenham aspas duplas como a próxima saída:

  ##gff-version 3
    chr1    TAIR10  mRNA    3631    5899    .   +   .   ID "AT1G01010.1" ;geneID "AT1G01010" ;gene_name "AT1G01010"
    chr1    TAIR10  exon    3631    3913    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    3996    4276    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    4486    4605    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    4706    5095    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    5174    5326    .   +   .   Parent "AT1G01010.1"
    chr1    TAIR10  exon    5439    5899    .   +   .   Parent "AT1G01010.1"

Eu tenho testado com

awk '{sub($10, "\"&\""); print}' file.gtf

Obrigado por ler minha pergunta

    
por Irving El Pelofino Lopez 08.02.2018 / 02:30

1 resposta

0

rápido e sujo

sed -E 's#(ID|Parent|gene_name) ([0-9A-Za-z.]+)# \"\"#g'

    
por 08.02.2018 / 03:47

Tags