Multi-line tricks in Sublime Text

Man I love Sublime Text...

Anyway, so there I was making this Drupal site, and this content type needed a checkboxes widget with 51 options.  You know, the 'Allowed Values' fun in Drupal: "Enter 1 per line, in the format of key|value".  The client gave them to me in a spreadsheet, with separate columns for the key & value.

A couple years ago I would have been afraid.  Very afraid.  For some reason, this time I knew that Sublime had me covered.  I took the first column, select all, copy & paste into Sublime.  Then I selected all the text in Sublime, (CTRL A), and split my cursor into every line (CTRL SHIFT L), moved to the end of every line (END), and added the pipe (|).  With all lines still selected, I went back to the spreadsheet, selected all of the values column, and pasted it in... Hooray!  Sublime is so smart, it put each row on its own line and the work was done after a total of about 30 seconds.

<3 you Sublime Text.

 

Joshua Walker