Assim serve?

test <- scan("savedrecs.txt", sep = "\n", what = "")
matrix(test[grep("^AU|^DT|^PY|^VL|^BP", test)], ncol = 5, byrow = TRUE)


2014-05-22 17:48 GMT-03:00 Roney Fraga Souza <[email protected]>:

> Caros,
>
> Tenho o seguinte arquivo:
> https://gist.github.com/roneyfraga/ca682b6193c75e7be4bf
>
> Quero manter apenas as linhas que começam com AU, DT, PY, VL e BP no
> arquivo. O resultado seria:
>
> AU Lin, TH
> DT Article
> PY 2012
> VL 116
> BP 314
>
> AU Brodeur-Campbell, M
> DT Article
> PY 2012
> VL 116
> BP 320
>
>
> Agora preciso que a cada 4 linhas estas sejam transpostas, de modo que 
> ficaria assim:
>
>       
>       
>       
>       
>       
>       
>       
>               V1
>               V2
>               V3
>               V4
>               V5
>       
>       
>               AU Lin, TH
>               DT Article
>               PY 2012
>               VL 116
>               BP 314
>       
>       
>               AU Brodeur-Campbell, M
>
>
>               DT Article
>               PY 2012
>               VL 116
>               BP 320
>       
>
> Qualquer sugestão será bem vinda?
>
> Atenciosamente,
> Roney
>
>
>
> _______________________________________________
> R-br mailing list
> [email protected]
> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
> Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça
> código mínimo reproduzível.
>
_______________________________________________
R-br mailing list
[email protected]
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código 
mínimo reproduzível.

Responder a