<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Joe,<div><br></div><div><div><div>On Aug 1, 2012, at 4:12 PM, Joe Armstrong wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Tue, Jul 31, 2012 at 11:32 PM, Zabrane Mickael <<a href="mailto:zabrane3@gmail.com">zabrane3@gmail.com</a>> wrote:<br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm looking for something similar to this, but in Erlang:<br></blockquote><blockquote type="cite"><a href="http://code.google.com/p/externalsortinginjava/">http://code.google.com/p/externalsortinginjava/</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I found an old post suggesting file_sorter:<br></blockquote><blockquote type="cite"><a href="http://www.erlang.org/doc/man/file_sorter.html">http://www.erlang.org/doc/man/file_sorter.html</a><br></blockquote><blockquote type="cite">But file_sorter seems to only work on binary files.<br></blockquote><br>This is one of my favorite modules - it is very fast.<br><br>file_sorter sorts binary encoded terms.<br>Each entry is a 4 byte length header followed by term_to_binary(Term)<br><br>Here's an example of how to encode some terms, write them to a file<br>sort the file and read them back.<br></div></blockquote><div><br></div>Thanks for sharing this code. Very useful.</div><div><br></div><div><blockquote type="cite"><div>It happily sorts extremely large files .... well worth using<br></div></blockquote><div><br></div>It seems to work fine, but not yet very flexible.</div><div><br></div><div>Can we imagine a module on top of <b>file_sorter</b> which will mimics the Unix <b>sort</b> command </div><div>to work on plain text files (and not binary)?</div><div><br></div><div>At the end, I wanna be able to sort any disk file as with Unix <b>sort</b>.</div><div><br></div><div><blockquote type="cite"><div>In my case, I need something more flexible.<br><blockquote type="cite">What about controlling the Unix sort command from Erlang?<br></blockquote><br> os:cmd("sort <in >out").<br></div></blockquote></div><div><br></div>Yep. That's what I had in mind (or port command).</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>Regards,</div><div>Zabrane</div></span>
</div>
<br></div></body></html>