Daily Archives: May 19, 2016

perl toggle operator for extracting one table from mysql dump file

We did it with a nifty one liner perl command that uses the TOGGLE operator. zcat fast.dmp.12082014_13_03.sql.gz |perl -ne ‘if (/CREATE TABLE `budget`/../UNLOCK/ ) {print $_; }’ > budget.1208.sql This looks for lines in the dump between lines that match … Continue reading

Posted in Uncategorized | Leave a comment