Matt's Blog

I have a lot of books...

Sat Jul 15 16:15:21 BST 2006

Moving back to Australia soon. Need to know what books I have and which boxes they are in for packing and possible replacement if any boxes do not arrive. Solution:

  1. Enter the ISBN numbers into a text file as 11 digit strings, one per line. Call this file isbnList.txt
  2. One line shell script:

    cat isbnList.txt | sed -e "s-^-" | xargs -J % curl % | grep "" > booknames.txt</p></li> <li><p>Clean up booknames.txt in Vim to remove the leading and trailing title tags. %s/^\s<title>// and similar for the trailing tag</p></li> <li>paste isbnList.txt booknames.txt > isbnandname.txt</li> </ol> <p>Result:</p> <pre><code>0521643147 The Mathematica Book 0521377099 Student Manual for the Art of Electronics 0471599891 No Title Found 0195107365 No Title Found 0201540908 Mathematica for Scientists and Engineers 020154217X Applied Mathematica: Getting Started, Getting It Done 0201537966 Mathematica for Physics 0201528207 No Title Found 019859965X Modern Classical Optics 0198506961 Atomic Physics 0070323305 Fundamentals of Optics ... </code></pre> <p>The No Title Found entries seem to always be international editions of textbooks which are not for sale in the USA.</p> <p>[<a href="blog/blog_unix/blog_unix.html">unix</a>]</p> <p>[<a href="blog/perm_2006_07_15_161521.html">permlink</a>]</p> </div> <div id="catnav"> <div class="catnavcell"><p><a href="">code</a> (24)</div> <div class="catnavcell"><a href="">cooling</a> (4)</div> <div class="catnavcell"><a href="">erlang</a> (5)</div> <div class="catnavcell"><a href="">ideas</a> (19)</div> <div class="catnavcell"><a href="">lisp</a> (1)</div> <div class="catnavcell"><a href="">me</a> (11)</div> <div class="catnavcell"><a href="">notes</a> (4)</div> <div class="catnavcell"><a href="">ocaml</a> (1)</div> <div class="catnavcell"><a href="">physics</a> (45)</div> <div class="catnavcell"><a href="">politics</a> (5)</div> <div class="catnavcell"><a href="">qo</a> (7)</div> <div class="catnavcell"><a href="">security</a> (2)</div> <div class="catnavcell"><a href="">unix</a> (6)</div> <div class="catnavcell"><a href="">vim</a> (3)</p></div> </div> </div> </div></body> </html>