<div dir="ltr">+1 for "tr -d '\0' < file > newfile", based on the updated description.<div>But "prevention is better than a cure" - find a way to avoid this in the first place.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 July 2015 at 07:22, Boruch Baum <span dir="ltr"><<a href="mailto:boruch_baum@gmx.com" target="_blank">boruch_baum@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I see that I'm late to the discussion and that your original problem has<br>
morphed a bit. Maybe the simplest and oldest solution is the `tr -d'<br>
command. See `man tr'.<br>
<span class=""><br>
On 07/20/2015 04:56 AM, Orna Agmon Ben-Yehuda wrote:<br>
> Hello everyone,<br>
><br>
> I often have damaged text files (due to a lovely storage system). The files<br>
> are of different formats, although I can usually assume they contain<br>
> spaces. The files are structured as lines.<br>
><br>
> Every once in a while, the lovely destruction (ahm....storage) system<br>
> inserts binary garbage to the file. I wish to fix the files by removing the<br>
> cancer without leaving any leftovers. That is, I want to lose partial lines.<br>
><br>
> I tried using grep with all sorts of keys, but it did not do the trick.<br>
> strings catches too little - it leaves partial lines.<br>
> Is there an elegant way to do the trick line-wise?<br>
><br>
> Thanks<br>
> Orna<br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> Linux-il mailing list<br>
> <a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
> <a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
hkp://<a href="http://keys.gnupg.net" rel="noreferrer" target="_blank">keys.gnupg.net</a><br>
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0<br>
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><a href="http://au.linkedin.com/in/gliderflyer" target="_blank"><img src="https://static.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x25.png"></a><br></div></div>
</div>