troubleshooting Question

Should be an easy regex/grep question

Avatar of paries
paries asked on
2 Comments1 Solution269 ViewsLast Modified:
this should be an easy regex/grep question.
i have an gzip sql file that has entries like:
INSERT INTO `newsletter` VALUES (50,'mydir',0,0,'white','','','','',0,1);
there are bunch of entries in this file and the 50 is an id.
There are also lots of other tables in this file as well.
I tried this but my regex skills sucks:
#gunzip --stdout mysql.7-30-2007.dmp.gz | grep -i "INSERT INTO \`newsletter\` VALUES (*,\'mydir\',"
the above line fails
but this works(but does not do anything for me, cause i need that mydir)
#gunzip --stdout mysql.7-30-2007.dmp.gz | grep -i "INSERT INTO \`newsletter\` VALUES "

so what i am trying to do is find everything with "INSERT INTO `newsletter` VALUES (50,'mydir'", but the 50 can be anything.

thanks for any help

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros