title: How to switch columns of a text file?
body: <p>I want to switch columns order in a bunch of text files and also remove some of the columns after switching. I'm trying to use <code>textscan</code> function in matlab. But I'm not sure how to do it.
  This is a sample line in one of the text files (space is delimiter):</p>
  
  <blockquote>
    <p>580.697942 1009.223279 3.012318 2 1 0 554 605 607 558 1004 996 1016 1021</p>
  </blockquote>
  
  <p>For example, I want to bring the forth-to-sixth column to the first of the line:</p>
  
  <blockquote>
    <p>2 1 0 580.697942 1009.223279 3.012318 554 605 607 558 1004 996 1016 1021</p>
  </blockquote>
  
  <p>And maybe add some columns  (with value='0') afterwards.</p>
  
  <p>I would appreciate some advice on how to do this.
  Thanks</p>