Usando o grep:
grep -o '_POV1D.*' file
Não encontrei um exemplo semelhante nos fóruns. reguler_ex não sabe.
2018-08-15 19:13:48 - 192.168.30.166 Sunucu zamani sorgusu, komut: _POV1D|150|17201|2018|8|15|19|13|1|301|22|305|27|191300|0|225|10|8969|0|0|y|y|y|0|y|y|y|y|y|38930|0|y|y|y|y|y|y|y|*
_POV1D|150|17910|2018|8|15|19|13|1|336|7|349|10|191300|0|290|19|9235|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
2018-08-15 19:13:48 - utc|*
2018-08-15 19:13:48 - 192.168.30.166 Sunucu zamani sorgusu, komut: _POV1D|150|17242|2018|8|15|19|13|1|124|34|121|42|191300|0|222|24|8843|0|0|y|y|y|y|y|y|y|y|y|32689|0|y|y|y|y|y|y|y|*
2018-08-15 19:13:48 - 192.168.30.166 Sunucu zamani sorgusu, komut: _POV1D|150|17372|2018|8|15|19|13|1|156|49|160|64|191300|0|264|80|9881|y|0|y|y|y|y|y|y|y|y|y|28280|0|y|y|y|y|y|y|y|*
_POV1D|150|17205|2018|8|15|19|13|1|0|0|0|2|191300|0|195|52|8319|x|0|y|y|y|x|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
2018-08-15 19:13:48 - 192.168.30.166 Sunucu zamani sorgusu, komut: _POV1D|150|17981|2018|8|15|19|13|1|192|22|215|45|191300|0|281|83|10040|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
_POV10D|150|17330|2018|8|15|21|20|2|0|0|0|11|212000|315|341|354|330|308|y|268|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
2018-08-15 21:30:49 - 192.168.30.166 Sunucu zamani sorgusu, komut: _POV1D|150|17330|2018|8|15|21|30|1|0|0|0|0|213000|0|271|81|10046|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
_POV10D|150|17979|2018|8|15|23|0|2|326|3|338|9|230000|351|360|357|337|309|y|252|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
2018-08-15 21:30:49 - _last|17979|*|*
_POV1D|150|17979|2018|8|15|23|1|1|322|4|323|10|230100|0|262|84|10034|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
Em linhas com _POV, quero obter a linha até o final do POV.
Resultado esperado:
_POV1D|150|17201|2018|8|15|19|13|1|301|22|305|27|191300|0|225|10|8969|0|0|y|y|y|0|y|y|y|y|y|38930|0|y|y|y|y|y|y|y|*
_POV1D|150|17910|2018|8|15|19|13|1|336|7|349|10|191300|0|290|19|9235|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
_POV1D|150|17242|2018|8|15|19|13|1|124|34|121|42|191300|0|222|24|8843|0|0|y|y|y|y|y|y|y|y|y|32689|0|y|y|y|y|y|y|y|*
_POV1D|150|17372|2018|8|15|19|13|1|156|49|160|64|191300|0|264|80|9881|y|0|y|y|y|y|y|y|y|y|y|28280|0|y|y|y|y|y|y|y|*
_POV1D|150|17205|2018|8|15|19|13|1|0|0|0|2|191300|0|195|52|8319|x|0|y|y|y|x|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
_POV1D|150|17981|2018|8|15|19|13|1|192|22|215|45|191300|0|281|83|10040|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
_POV10D|150|17330|2018|8|15|21|20|2|0|0|0|11|212000|315|341|354|330|308|y|268|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
_POV1D|150|17330|2018|8|15|21|30|1|0|0|0|0|213000|0|271|81|10046|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
_POV10D|150|17979|2018|8|15|23|0|2|326|3|338|9|230000|351|360|357|337|309|y|252|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|y|*
_POV1D|150|17979|2018|8|15|23|1|1|322|4|323|10|230100|0|262|84|10034|y|y|y|y|y|y|y|y|y|y|y|x|y|y|y|y|y|y|y|y|*
Com sed e awk eu não consegui. O arquivo está desarrumado e é muito longo. Alguém pode me ajudar.
obrigado.
Usando sed
:
sed 's/^.*_POV/_POV/' file
Ou mais, mas talvez um pouco mais elegante, evita a referência _POV repetida
sed 's/^.*\(_POV.*\)//' file
Tags awk sed regular-expression