Tengo un archivo con 5,5 millones de líneas.
Ejemplo:
chr1 10000 10468 + (TAACCC)n Simple_repeat Simple_repeat
chr1 10468 11447 - TAR1 Satellite telo
chr1 11504 11675 - L1MC5a LINE L1
chr1 11677 11780 - MER5B DNA hAT-Charlie
chr10_GL383545v1_alt 11877 11980 - Alu ERV1
chr11_BL383595v1_alt 12077 12980 - Alu ERV1
chr3 11504 11675 - L1MC5a LINE L1
Me interesa conservar solo las filas que no tienen _
en la primera columna
La salida sería algo como:
chr1 10000 10468 + (TAACCC)n Simple_repeat Simple_repeat
chr1 10468 11447 - TAR1 Satellite telo
chr1 11504 11675 - L1MC5a LINE L1
chr1 11677 11780 - MER5B DNA hAT-Charlie
chr3 11504 11675 - L1MC5a LINE L1
No sé cuántas de mis filas no deseadas existen. Preferiblemente me gustaría usarlo, awk
pero los comandos bash normales también están bien.
Respuesta1
awk
es más adecuado para tratar con columnas
awk '$1 !~ /_/' file
!~
permite comprobar si algo no coincide con el patrón
Congrep
grep -v '^\S*_' file
o, si \S
no se reconoce,
grep -v '^[^[:space:]]*_' file