How can I delete the whole lines which included both subStr1 and subStr2 in a big file and save as a new smaller file.
Part of my file content below.
12-23 20:27:35:265 GetVariable [Tunnel] INFO iVid = 536876042 data [Reruen] = System.Object[]
12-23 20:27:35:265 GetVariable [Tunnel] INFO iVid = 536876043 data [Reruen] = System.Object[]
12-23 20:27:33:718 SendEvent [Link] INFO eventID = 268435564
12-23 20:27:33:718 WaferMove [Link] INFO waferNumber = 122253 UNIT_ID dest = UNIT_ID_LL_A slot = 1 bool isStarted = False
12-23 20:27:35:265 GetVariable [Tunnel] INFO iVid = 536876042 data [Reruen] = System.Object[]
12-23 20:27:35:265 GetVariable [Tunnel] INFO iVid = 536876043 data [Reruen] = System.Object[]
12-23 20:27:33:765 WaferMove(d) [Link] INFO waferNumber = 122253 UNIT_ID dest = UNIT_ID_LL_A slot = 1 bool isStarted = False
And I want to deleted all the lines include both GetVariable [Tunnel] and System.Object[]
like the lines below. THANKS.
12-23 20:27:35:265 GetVariable [Tunnel] INFO iVid = 536876043 data [Reruen] = System.Object[]
If you can afford to have a copy of the file (which is probably safer to do) then you can open two files (one for reading original file one for writing to the result file) and skip the lines where you find the match:
I haven’t tried the script, so make sure to test it on an example file first.
Edit: you need to tune the regex. play with it a little.