Extract single db/table from dump file

using sed to extract single database from the dumpfile:
=========================================
sed -n '/^-- Current Database: `dbname`/,/^-- Current Database: `/p' dumpfile > dbname.sql 2>error

eg:
sed -n '/^-- Current Database: `blogs`/,/^-- Current Database: `/p' dump.sql > blogs.sql 2>error

we can also use "awk" for the same.

extract single table from the dumpfile:-

Comments

Prabhat Kumar said…
sed -n '/^102244911/,/^106617781`/p' sourcefile > targetfil.csv

Popular posts from this blog

How do I Use the Linux Top Command?

IOPS measurement