SublimeText 2: Select lines that match search terms
Asked Answered
M

2

11

I need to select some lines inside of a list of file names to bring them at the end of the list.

Suppose I have Files.txt with this list:

filename1.aaa
filename1.bbb
filename1.ccc
filename2.aaa
filename2.bbb
filename2.ccc
filename3.aaa
filename3.bbb
filename3.ccc

I want to select all the lines where the file extension is ccc and then be able to CTRL-X and CTRL-V to put them on the bottom of the list. So the result have to be like this:

filename1.aaa
filename1.bbb
filename2.aaa
filename2.bbb
filename3.aaa
filename3.bbb
filename1.ccc
filename2.ccc
filename3.ccc

Is it possible?

Monomorphic answered 13/9, 2013 at 10:7 Comment(0)
T
21

In Windows press:

  1. Ctrl+F for searching all ".ccc" terms in file;
  2. Ctrl+L to expand selection to line;
  3. Ctrl+X to cut all selected lines;
  4. End to go at the end of your file;
  5. Ctrl+V to past all selected line;

If you are using a Mac press Command instead of Ctrl.

This page could also help you: http://www.sublimetext.com/docs/selection

Trivia answered 13/9, 2013 at 10:18 Comment(2)
I looked through a web search but didn't find anything. I didn't thought about the Sublime documentation... Thanks!Monomorphic
Use Alt+F3 to find all occurrences of the current wordPatch
K
1

This is very easy in Sublime, select the extension .ccc on one of the lines and then press Alt+F3 to select all other matching occurrences of that selected text. Then press Ctrl+L to expand selection to the entire line, then cut and paste those lines elsewhere.

Kordofanian answered 19/10, 2019 at 20:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.