ruby -ne '@found=true if $_ =~ /^CREATE TABLE `foo`/i; next unless @found; exit if $_ =~ /^CREATE TABLE (?!`foo`)/i; puts $_;' giant_sql_dump.sql > foo.sql
Ruby One-liner for Restoring One Table from a Huge SQL Dump
Leave a Reply
You must be logged in to post a comment.