title: Print file in particular order in bash
body: <p>I have file with content:</p>
  
  <p>file.txt:</p>
  
  <pre><code>Iteration 1
  RAM: +456ms
  Cache: +142ms (total +417ms)
  
  Iteration 2
  Spec: +152ms
  Cache: +149ms (total +413ms)
  
  Iteration 3
  RAM: +184ms
  Spec: +172ms
  Searchms: +131ms (total +385ms)
  
  First launch 4
  RAM: +149ms
  Searchms: +188ms
  </code></pre>
  
  <p>In this file between every <code>First launch</code>, content can be different, it is not fixed ( for example: First launch 3 contain three elements while First launch 2 contents only 2 elements), so any number of content can be between the <code>First launch</code> pattern which is not known at the beginning.</p>
  
  <p>Expected Output:</p>
  
  <pre><code>RAM  456 184 149
  Cache 142 149  
  Spec 152 172
  Searchms 131 188
  </code></pre>
  
  <p>Due to not knowing exact approach,I have tried this code.</p>
  
  <p>My code:</p>
  
  <pre><code>for i in {1..4}
  do
  awk "/First launch $i/{flag=1;next} /First launch $((i+1))/{flag=0} flag" file.txt&gt; fl$i.txt
  sed -i 's/\+//g' fl$i.txt
  sed -i 's/://g' fl$i.txt
  sed -i 's/(.*//g' fl$i.txt
  sed -i 's/ms//g' fl$i.txt
  awk '{print $1 "\t" $2}' fl$i.txt
  done
  </code></pre>
  
  <p>My output has two issues:
  I am generating the file for each pattern which is wrong. Also I wanted to remove  <code>ms</code> after the time but it also removes the <code>ms</code> from the pattern name (ex: Searchms to Search)</p>
  
  <p>Output: </p>
  
  <pre><code>fl1.txt: 
      RAM     456
      Cache   142
  fl2.txt : 
      Spec    152
      Cache   149
  fl3.txt  :
      RAM     184
      Spec    152
      Search  131
  fl4.txt : 
      RAM     149
      Search  188
  </code></pre>
  
  <p>Please suggest me an approach to get the expected output without generating any extra file with the constraint of removing <code>ms</code> after the time.</p>