georg
georg

Reputation: 315

combine two blocks of text with equal number of lines in emacs

Suppose I have the following lines of text

aa aa

bb bb 

cc cc

xx xx

yy yy 

zz zz 

etc

Using emacs I want to combine the lines in columns:

aa aa    xx xx

bb bb    yy yy

cc cc    zz zz

etc

Is this possible?

Upvotes: 1

Views: 71

Answers (1)

choroba
choroba

Reputation: 241868

Select the second part of the file (future new columns), kill it with kill-rectangle (C-xrk).

Go to the end of the first line, add a space, yank the rectangle using yank-rectangle or C-xry.

Upvotes: 4

Related Questions