<p>Use stream editing tools (sed, awk, etc.) in as few pipelines as possible. I have to do things like that all the time. </p>
<p>If necessary, use a HLL to create a custom made filter as part of the pipeline. </p>
<div class="gmail_quote">On Sep 25, 2012 5:08 PM, &quot;James Taylor&quot; &lt;<a href="mailto:James.Taylor@eastcobbgroup.com">James.Taylor@eastcobbgroup.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any suggestions for editing a 37GB file?<br>
-jt<br>
<br>
&gt;&gt;&gt; &quot;James Taylor&quot; &lt;<a href="mailto:James.Taylor@eastcobbgroup.com">James.Taylor@eastcobbgroup.com</a>&gt; 9/25/2012   04:15 PM &gt;&gt;&gt;<br>
He did indicate in another email that he did drop the the table.<br>
I&#39;ll pass this along and see what he has to say.<br>
-jt<br>
<br>
<br>
&gt;&gt;&gt; Mike Harrison &lt;<a href="mailto:cluon@geeklabs.com">cluon@geeklabs.com</a>&gt; 9/25/2012   03:46 PM &gt;&gt;&gt;<br>
<br>
We do this XX times a day. Usually works great.<br>
<br>
<br>
Is there a good chance it already exists?<br>
<br>
I don&#39;t usually see the COLLATE= statement,<br>
other than that, it looks OK. (and that should be ok.. but worth playing<br>
with?)<br>
<br>
Usually there is a &quot;drop table&quot; command just above the &quot;create table&quot;<br>
command, might be worth checking.<br>
<br>
In rare cases, when transported via weird methods,<br>
I&#39;ve seen garbage in these files, especially when dealing with strange<br>
character sets.<br>
<br>
What I would do:<br>
<br>
Cut out that section of the file and try running it.<br>
<br>
from the drop above the create to the next table&#39;s drop/create statement.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
============================================================<br>
Mike Harrison   <a href="mailto:bogon@geeklabs.com">bogon@geeklabs.com</a>  cell: <a href="tel:423.605.6943" value="+14236056943">423.605.6943</a><br>
<br>
On Tue, 25 Sep 2012, James Taylor wrote:<br>
<br>
&gt; One of my clients is trying to test a disaster recover scenario by restoring a mysql database to an offsite disaster recovery server.<br>
&gt;<br>
&gt; He has determined he needs to disable foreign key checking. He add the following to the mysqld section of my.conf<br>
&gt;<br>
&gt; init_connect=&#39;SET foreign_key_checks = 0&#39;<br>
&gt;<br>
&gt; But it didn&#39;t work for him.<br>
&gt; He created a regular user to use for the import, which he thinks he needs to do.<br>
&gt;<br>
&gt; Here&#39;s the output when the problem occurs.<br>
&gt;<br>
&gt; omniprise-db1-dr:/utility # mysql -uroot -pchanged &lt; omniprise_backup.sql<br>
&gt; ERROR 1005 (HY000) at line 36332: Can&#39;t create table &#39;ERP_DATABASE.heartbeat&#39; (errno: -1)<br>
&gt;<br>
&gt; omniprise-db1-dr:/utility # head -n 36340 omniprise_backup.sql | tail -n 9<br>
&gt; CREATE TABLE `heartbeat` (<br>
&gt;  `id` int(10) unsigned NOT NULL DEFAULT &#39;0&#39;,<br>
&gt;  `ts` datetime DEFAULT NULL,<br>
&gt;  PRIMARY KEY (`id`)<br>
&gt; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;<br>
&gt; /*!40101 SET character_set_client = @saved_cs_client */;<br>
&gt;<br>
&gt; --<br>
&gt; -- Dumping data for table `heartbeat`<br>
&gt;<br>
&gt; omniprise-db1-dr:/utility # wc -l omniprise_backup.sql<br>
&gt; 133974 omniprise_backup.sql<br>
&gt;<br>
&gt; Any thoughts?<br>
&gt;<br>
&gt; Keep in mind that I&#39;m not working directly with this and I&#39;m not strong on mysql administration.<br>
&gt;<br>
&gt; -jt<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; James Taylor<br>
&gt; 678-697-9420<br>
&gt; <a href="mailto:james.taylor@eastcobbgroup.com">james.taylor@eastcobbgroup.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Ale mailing list<br>
&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
If this is an unsolicited spam message, please click this link to report it: <a href="http://control.eastcobbgroup.com:49285/contents/spamreport.shtml?rptid=13494&amp;srvid=16vl15t" target="_blank">http://control.eastcobbgroup.com:49285/contents/spamreport.shtml?rptid=13494&amp;srvid=16vl15t</a><br>

<br>
<br>
<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
If this is an unsolicited spam message, please click this link to report it: <a href="http://control.eastcobbgroup.com:49285/contents/spamreport.shtml?rptid=13496&amp;srvid=16vl15t" target="_blank">http://control.eastcobbgroup.com:49285/contents/spamreport.shtml?rptid=13496&amp;srvid=16vl15t</a><br>

<br>
<br>
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div>