Remover linhas de um arquivo

0

No meu arquivo de saída eu tenho as linhas abaixo incluídas várias vezes junto com a saída necessária.

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.

Veja como é a minha saída.

####################################################################
Raw Error: count of the error records with latest trans session in "audit_preatlas_wb4370_raw_error_05012016073248" table
====================================================================
count   trans_session

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
********************************************************************
Raw Audit: Total records available in "audit_preatlas_wb4370_raw_audit_05012016073248" table
====================================================================
count   trans_session

Raw Audit: Distinct records of "audit_preatlas_wb4370_raw_audit_05012016073248" table
====================================================================
count   trans_session

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
Raw Audit : count of duns with error "gbwr_raw_audit_mandatory_field" code in "audit_preatlas_wb4370_raw_audit_05012016073248" table
====================================================================
count   trans_session   error_code

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
Raw Audit : count of duns with error "gbwr_raw_audit_numeric_field" code in "audit_preatlas_wb4370_raw_audit_05012016073248" table
====================================================================
count   trans_session   error_code

WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.

Como posso remover as linhas WARN sozinho?

    
por Alex Raj Kaliamoorthy 19.05.2016 / 16:01

1 resposta

2

Existem algumas maneiras. Para resumir os comentários acima, você pode fazer o seguinte:

awk:

awk '!/^WARN/' filename

sed:

sed '/^WARN/d' filename

grep:

grep -v '^WARN' filename
    
por 19.05.2016 / 16:21