Sublime Text 2 Adding 1 column to another

Ok, so I have 2 files with a lot of data in the columns that I need. I find it difficult to put into words, so let me try to give an example.

File 1 contains:

Server1; 15min load 0.20 at 16 CPUs; Server2; 15min load 0.46 at 4 CPUs; Server3; 15min load 0.10 at 16 CPUs; ... 

File 2 contains:

 72.4% (12.01) 73.9% (12.26) 72.1% (11.97) ... 

What I need:

 Server1; 15min load 0.20 at 16 CPUs; 72.4% (12.01) Server2; 15min load 0.46 at 4 CPUs; 73.9% (12.26) Server3; 15min load 0.10 at 16 CPUs; 72.1% (11.97) ... 

Dots are thousands of lines, therefore, you need to automate. I tried everything that could work:

  • Ctrl + a in file 2, then Ctrl + a , Ctrl + Shift + L in file 1 before pasting
  • Ctrl + a , Ctrl + Shift + L in file 2, then Ctrl + a , Ctrl + Shift + L in file 1 before pasting

I somehow did this before, but now I'm trying to replicate.

I know this can be done in a shell script, but I am very curious about how Sublime text controls it.

Thanks in advance!

+6
source share
3 answers

Go to file2, click:

Ctrl + A , Ctrl + c (select all, then copy)

...

Then go to file1 and click sequentially:

Ctrl + A , Ctrl + Shift + L , , Space , Ctrl + v (select all, divide into lines, move the cursor to the end of each line, insert a space, paste the contents.

+16
source

The answer described by @ HugoCorrá still works in Sublime 3 on Windows 8. But you SHOULD make sure that the number of rows selected matches the number of rows to paste or does not work (it pastes a copy of the entire clipboard in each selection).

Alternatively, use the text pastry plugin for Sublime, a very good multi-line insert tool. The difference is that you select the text to insert with standard CTRL + A Ctrl + C. Then select all the insertion points in the second document (as indicated in @ HugoCorrá), but do not do Ctrl + V. Instead, use the text dough Ctrl + Alt + N. Then at the command line use \p to paste from the clipboard. An example is given below here .

+5
source

In my Sublime build 3126, SHIFT + Right Button to select block B, CTRL + C to copy block B to the clipboard. Right Button, click the upper right part of block A, move the mouse to the lower right part of block A to select the line ends of all lines. CTRL + V to insert. The SHIFT + Right Button to select is a key step.

0
source

Source: https://habr.com/ru/post/943685/


All Articles