Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top