Author: Peter Salisbury Date: To: Hampshire LUG Discussion List Subject: Re: [Hampshire] File slicing
On Monday 19 February 2007 17:47, John Hunt wrote: > Hi,
>
> I have a huge file which contains a mysqldump of all the databases
> on a server, I'm after just a specific part of it, that is, the
> table data for phpbb within a database called rgse.
>
> The file is wayy too big for the likes of emacs etc, so I was
> wondering if anyone knows how to crop off the everything until a
> line with CREATE DATABASE rgse, and everything after CREATE
> DATABASE?
>
> Cheers,
> John.
Hi John,
Just had to do the exact same thing - try the csplit command, in my
case I used:
csplit 070219.sql "/-- Table structure for table/" {*}
Which produces a different file for each table in the database.