문제

working on a large text file and I'd like to remove all lines that don't contain the text "event":"click"}]

I've tried to do some regex within Sublime 3 and can't get it to stick.

도움이 되었습니까?

해결책

I have not used sublime but you could select all line not containing the text "event":"click"}] with the regex:

^(.(?!"event":"click"\}\]))*$

I think you could replace them by nothing(empty string) or backspace

다른 팁

Use this one to get result to stdout

sed -n '/"event":"click"\}\]$/p' your_large_file

Use this one to keep only lines that end with "event":"click"}], your_large_file.old backup will be generated

sed -i.old -n '/"event":"click"\}\]$/p' your_large_file
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top