Remove lines with Pattren Matching

Hi ,

I need to remove the lines that matches the pattern

TABLEEXCLUDE *.AQ$_*_F ;

* is wildcard, it can be any word.

For example, I have following file:

TABLEEXCLUDE THOT.AQ$_PT_ADDR_CLEANUP_QTAB2_F ;
TABLEEXCLUDE THOT.AQ$_MICRO_SERVICE_QT_F ;
TEST
TABLEEXCLUDE THOT.AQ$_TEST_B ;
TABLEEXCLUDE THOT.AQ_T_F ;

I need o/p:

 TEST
 TABLEEXCLUDE THOT.AQ_T_F ;

What operating system and shell are you using?

Is there some reason why grep with a basic regular expression:

grep -v 'TABLEEXCLUDE .*\.AQ\$_.*_F ;' file

doesn't work for you?

Why shouldn't the output be:

TEST
TABLEEXCLUDE THOT.AQ$_TEST_B ;
TABLEEXCLUDE THOT.AQ_T_F ;

? I don't see why the _B shown in red above should match the pattern you provided.

Update: Since you didn't use CODE tags in your post, we couldn't see that you want a leading <space> added to your output. Is this really required?