1

I didn't find a similar example in the forums. reguler_ex don't know.

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|*

In rows with _POV, I want to get the line to the end from POV.

Expected Output:

_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|*

With sed and awk I could not. The file is untidy and too long. Can anyone help me.

thanks.

1

Using grep:

grep -o '_POV1D.*' file
0

Using sed:

sed 's/^.*_POV/_POV/' file

Or, longer but perhaps a little more elegant, avoids the repeated _POV reference

sed 's/^.*\(_POV.*\)/\1/' file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.