Malcolm V wrote:
> On Wednesday 10 May 2006 18:54, Rob Sharp allegedly wrote:
> <snipped>
>> Anyone have any pointers on how I can split the file based on the string
>> 'CREATE TABLE' or something like that? A file per table would be fine to
>> import.
> 
> I've never used it, but I think csplit is what you are after.

Csplit seems to do the trick, although it's segfaulting on me. Here's an
strace:

open("xx05", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4
fstat64(4, {st_mode=S_IFREG|0666, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xf6e96000
read(3, "nything? Come on...Tell me what "..., 3074) = 3074
read(3, "758374),(44,97,4575,15912,\'Sutek"..., 8192) = 8192
read(3, "),(87,154,34832,42439,\'Perfectio"..., 16384) = 16384
brk(0)                                  = 0x9b45000
brk(0x9b68000)                          = 0x9b68000
read(3, "by <a href=\\\'http://www.inthemix";..., 32768) = 32768
brk(0)                                  = 0x9b68000
brk(0)                                  = 0x9b68000
brk(0x9b58000)                          = 0x9b58000
brk(0)                                  = 0x9b58000
read(3, " the migration of 19 white pages"..., 65536) = 65536
mmap2(NULL, 266240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xf6e55000
read(3, "617,\'Optimus Rhyme\',\'\',\'<i>Untit"..., 131072) = 131072
munmap(0xf6e55000, 266240)              = 0
mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xf6dd4000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

Any ideas what could be broken? Csplit manages to chop into few files
then segfaults.

Thanks,
Rob.



Attachment: signature.asc
Description: OpenPGP digital signature

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to