title: Bash - How to format file in orderly manner?
body: <p>This is driving me nuts...</p>
  
  <p>I have a file <code>BookDB.txt</code> which stores data in the following format :</p>
  
  <pre><code>Python for dummies:Pauline:10.45:4:3
  Python for dummies:Peter:10.67:0:11
  C++ for dummies:Jared Loo:10.56:1:9
  </code></pre>
  
  <p>I want to print an inventory summary of all the books by replacing the (:) delimiter with a (/t) using this command : </p>
  
  <p><code>sed 's/:/\t/g' cat BookDB.txt)</code></p>
  
  <p>But it simply concatenates all the lines into two lines, such that it looks like this :</p>
  
  <pre><code>Title            Author          Price          Qty Avail         Qty Sold       Total Sales
  ---------------------------------------------------------------------------------------------------
  Python for dummies Pauline 10.45 4 3 Python for dummies Peter 10.67 0 11 C++ for dummies Jared Loo 10.56 1 9
  Python for dummies Pauline 10.45 4 3 Python for dummies Peter 10.67 0 11 C++ for dummies Jared Loo 10.56 1 9
  </code></pre>
  
  <p>Essentially , I want my output to look like this :</p>
  
  <pre><code>Title               Author                Price          Qty Avail.               Qty Sold
  -------------------------------------------------------------------------------------------
  Python for dummies  Pauline                10.45             4                       3
  Python for dummies  Peter                  10.67             0                       11
  C++ for dummies     Jared Loo              10.56             1                       9
  </code></pre>
  
  <p>Is there a better way to achieve this other than a modification of the sed command listed above?</p>