The title says it all: I working on a large Holy Bible project and have two large plain text files representing two different versions, and I'm using the COMPARE plugin to notice differences in the 'ole King James.

Notepad++ v7.5.1 (32 bit), COMPARE plugin v1.5.6.2, Windows7

However, one version has the verse numbers in italics and the other doesn't - no big deal, except that COMPARE will put a warning triangle on each text line stating a difference, which is distracting from actual noteworthy differences (spelling, punctuation, etc, which really is my goal) and this is slowing me down.

The rub: I can't just rip REPLACE through, deleting all /italics/ as many of the words are italicized and must stay that way; thus I would like to change one of the versions from having italicized verse numbers to just plain number text, but just the numbers and not any words.

Example: From: /3/; /45/ To: 3; 45

Then, when it's all said and done I'd like to change that copy to have superscript verse numbers for all: from 3 or 45 to ^3 or ^45.

Additionally, if I could change both versions to have superscript verse numbers now, then that would be just fine too, and probably preferred.

There appears to be much info on changing font colors, etc, but little on using REPLACE for the actual 1-99 number set. Will someone please help me?

Thank you in advance, God bless. --John

  • @JohnTheBabtized Regular expressions (so-called "regexs") are very useful for working with large documents, but it takes a little patience to learn, and some foresight to minimize the amount of proofreading you need to do afterwards. Is there some consistent piece of text (or perhaps the beginning of a new line) which always occurs next to the numbers you want to change, and which separates them from any numbers you don't want to change? Including that in any regex you use would simplify your proof-reading afterwards, albeit perhaps by making the regex more complicated. – jpaugh Oct 9 '17 at 21:51
  • (If you are okay with removing italics from all numerals, then Alberto's answer is likely adequate.) – jpaugh Oct 9 '17 at 21:52
  • @Alberto Martinez - many thanks Alberto, worked beautifully! If I wish to change the other file that has no formatting for numerals to be identical to the new file, which has superscript numbers (thanks to you) how do I do that? I tried a few variations but was not successful. Just to be clear: I wish to change all numerals (numbers) in one text file to be superscript. – JohnTheBaptized Oct 15 '17 at 19:36
  • I'm not sure whether Alberto will be notified of your comment, unless you comment on his answer. (I was notified because of my earlier comment.) – jpaugh Oct 17 '17 at 14:37

You can replace one format with another in just one operation using the replace dialog with the regular expression mode:

  • Open the replace dialog (Ctrl+H).
  • Select Regular expression in Search mode.
  • Put /([0-9]*)/ in Find what, this will find all the groups of numbers (and only numbers) between / /.
  • Put ^$1 in Replace with, this will replace the groups found with only the numbers and a ^ before them (if you just want to remove the / / then use $1 in Replace with).

Notepad++ regular expression

As a precaution you should make a backup since this will modify the whole file, if you only want to replace a part of the file select that part before opening the replace dialog and check In selection in addition of the other steps.

| improve this answer | |
  • You'll also want to find something consistent to anchor the verse numbers to, so that you don't end up replacing all the numbers, especially if it's a large document which cannot be manually proof-read afterwards. Anchoring to the beginning of line /^\s*([0-9]*)/ or even a period /([0-9]*)\./ would probably be adequate, assuming, respectively, that the verse numbers are at the beginning of the line, or are followed by a period. – jpaugh Oct 9 '17 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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