<div dir="ltr">tr does what strings does - clears only the characters, not the full bad line. Not what I wanted.<div>but now that I know what data I have there, I can clear it using any script (back to Dov's solution).</div><div><br></div><div>Thanks everyone!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 21, 2015 at 2:20 AM, Amos Shapira <span dir="ltr"><<a href="mailto:amos.shapira@gmail.com" target="_blank">amos.shapira@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><span class="">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></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">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><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></span><span class="">
> <a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">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><span><font color="#888888"><br>
<br>
--<br>
hkp://<a href="http://keys.gnupg.net" rel="noreferrer" target="_blank">keys.gnupg.net</a><span class=""><br>
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0<br>
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
</span><span class=""><a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">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>
</span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><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>
</font></span></div>
<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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Orna Agmon Ben-Yehuda.<br><a href="http://ladypine.org" target="_blank">http://ladypine.org</a></div>
</div>