I have a text file with over 184 thousand lines. This is the output from a particular application and is basically the dump of the database in JSON format. I need to select the lines which are between curly braces. For example, my file would have some text like this like this:

{..
..
...
}

{
...
....
.....
  |
  30,000 lines later
  |
...
...
}

I need to select these 30,000 odd lines and paste it somewhere else. Is there any Text editor which lets you do a selection based on edge characters?

I work with both Linux & Windows.

link|improve this question

67% accept rate
feedback

1 Answer

up vote 3 down vote accepted

Vim will all you to select everything between matched brackets when the cursor is over one of the brackets with:

shift + v (start a line selection)

shift + 5 ("bounce" to other bracket)

Then hit y to copy or d to cut, and p to paste.

Gvim, the graphical version of Vim is available on both Windows and Linux.

To install on Ubuntu or Debian:

sudo apt-get update && sudo apt-get install vim-gnome;

Then run with the icon or:

gvim &

But what are you actually wanting to do with this text? It sounds like a simple program might be a better bet?

link|improve this answer
Thank you.It worked like a charm! – Devdatta Tengshe Jul 9 '11 at 12:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.