Search code examples
appendkeyboard-shortcutssublimetext2

Sublime Text 2 Appending 1 column to another


Ok, so I have 2 files with a lot of data in columns that I need join. I'm finding it hard to put into words so let me try and 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 is:

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)
...

The dots represent thousands more lines hence the need for automation. I've tried everything that might work:

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

I've somehow done this before but am now struggling to replicate.

I'm aware this can be done in shell script but I'm really curious as to how Sublime text manages it.

Thanks in advance!


Solution

  • Go to the file2, press:

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

    ...

    Then go the the file1 and press in sequence:

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