Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2018, 01:20 PM   #1
Sam Sahara
Connoisseur
Sam Sahara doesn't litterSam Sahara doesn't litterSam Sahara doesn't litter
 
Posts: 79
Karma: 228
Join Date: Aug 2014
Device: lambda k21
[request] New feature about text selection

Hallo Kovid.

The scenario is: a huge html file to manage, 30000 lines long; I have to run a regex on a certain quote of the file, say from line 33 to line 12612. I have to click on line 33, then shift the cursor through the file up to line 12612, and only then release the mouse button, Alt-Shift-M to mark the region, run the regex.

But selecting such a big chunk of text lines is very difficult and prone to errors.

A useful feature to solve the problem would are two html editor commands:

Code:
right-click -> select -> begin
to mark the point from where start the selection;

Code:
right-click -> select -> end
to mark the point to where end the selection.

In the case above I should go to line 33, right-click -> select -> begin, then slowly and comfortably go up to line 12612, right-click -> select -> end, Alt-Shift-M, and finally run the regex.

A much more useful version of the same feature (but a bit more complex) would be the ability to select the start and the end of the region via a regex, a command like: "select from the line that match the regex "A" up to the line that match the regex "B"".

ss

Last edited by Sam Sahara; 07-31-2018 at 02:05 PM.
Sam Sahara is offline   Reply With Quote
Old 07-31-2018, 05:33 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Since you want to use a regexp to select a region to use another regexp on anyway just modify the search/replace regexp it to only match the region of interest. And note that you can press Ctrl+. to jump to any line number (although that will not help with marking).
kovidgoyal is offline   Reply With Quote
Advert
Old 07-31-2018, 08:00 PM   #3
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
Why not just put the cursor at the start of the text you want, release mouse, go down to the end of the desired text, and shift-click? This is how I always select large sections.
retiredbiker is offline   Reply With Quote
Old 08-23-2018, 11:17 AM   #4
Sam Sahara
Connoisseur
Sam Sahara doesn't litterSam Sahara doesn't litterSam Sahara doesn't litter
 
Posts: 79
Karma: 228
Join Date: Aug 2014
Device: lambda k21
Quote:
Originally Posted by kovidgoyal View Post
Since you want to use a regexp to select a region to use another regexp on anyway just modify the search/replace regexp it to only match the region of interest.
It is not possible in every case. The use of one or more regexes to select a region (into which operate some changes with other regexes) is a common tecnique with vim or emacs.

ss
Sam Sahara is offline   Reply With Quote
Reply

Tags
editor, regex, select text


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature request: accented characters and plain-text copy & paste holymadness Library Management 3 07-15-2014 02:47 PM
A wee request regarding search notification (and file selection) sherman Editor 1 04-06-2014 10:50 AM
Feature request, unlock text color. bizzybody Conversion 2 10-23-2011 12:05 AM
Feature request: full text search Laisvunas EPUBReader 3 04-03-2011 11:47 AM
Feature request for formatting text speakingtohe Calibre 0 08-06-2010 11:17 PM


All times are GMT -4. The time now is 12:03 PM.


MobileRead.com is a privately owned, operated and funded community.