title: Remove the first character of each line and append using Vim
body: <p>I have a data file as follows.</p>
  
  <pre><code>1,14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065
  1,13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050
  1,13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185
  1,14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480
  1,13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735
  </code></pre>
  
  <p>Using vim, I want to reomve the 1's from each of the lines and append them to the end. The resultant file would look like this:</p>
  
  <pre><code>14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065,1
  13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050,1
  13.16,2.36,2.67,18.6,101,2.8,3.24,.3,2.81,5.68,1.03,3.17,1185,1
  14.37,1.95,2.5,16.8,113,3.85,3.49,.24,2.18,7.8,.86,3.45,1480,1
  13.24,2.59,2.87,21,118,2.8,2.69,.39,1.82,4.32,1.04,2.93,735,1
  </code></pre>
  
  <p>I was looking for an elegant way to do this. </p>
  
  <p>Actually I tried it like </p>
  
  <pre><code>:%s/$/,/g 
  </code></pre>
  
  <p>And then</p>
  
  <pre><code>:%s/$/^./g
  </code></pre>
  
  <p>But I could not make it to work.</p>
  
  <p><strong>EDIT :</strong> Well, actually I made one mistake in my question. In the data-file, the first character is not always 1, they are mixture of 1, 2 and 3. So, from all the answers from this questions, I came up with the solution --</p>
  
  <pre><code>:%s/^\([1-3]\),\(.*\)/\2,\1/g
  </code></pre>
  
  <p>and it is working now.</p>