Nikos,

The one line :%s way that was posted before is the truly elegant way of
solving this problem. However, I found that macros are especially
appropriate in this case. I was able to execute the whole task in 15
seconds by recording a macro for the first line, and then playing it
back 26 times. Remember "q" is for recording macros.

--Matt

On Thu, May 25, 2006 at 05:26:16PM +0300, Nikolaos A. Patsopoulos wrote:
> Hi all,
> 
> I've got a series of files in the following format (tab delimited):
> 
> 1    1    0    0    0
> 2    0    0    0    0
> 3    0    0    0    0
> 4    1    1    1    0
> 5    1    1    0    0
> 6    0    0    0    0
> 11    1    1    0    1
> 12    1    1    1    1
> 13    0    0    0    0
> 14    0    0    0    0
> 15    1    0    0    0
> 16    1    1    0    0
> 21    1    1    0    1
> 22    1    0    0    0
> 23    0    1    0    0
> 24    1    1    1    0
> 25    1    1    1    1
> 26    0    0    0    0
> 27    0    0    0    0
> 
> 
> I want to transform them in the following format:
> #1
> 1 0
> 0 0
> #2
> 0 0
> 0 0
> etc..
> 
> 
> In detail:
> 1.I want in front of the number in the first column to add  "#" , then  
> change line after the value
> 2. change line after 3rd column
> 3. change line after 5th column
> 4. repeat all three steps
> 
> Any ideas??
> 
> Thanks in advance,
> 
> Nikos
> 

Reply via email to