Swapping two values without using an intermediate one

2

In a given text file, generally speaking, if I want to swap two things, say the word apple with the word orange, and both exist in the document, then I first have to change one of them to something that is not found in the document, change the other, and then change the first one back.

It would be nice to be able to do this in any of the following programs:

  • word
  • Excel
  • Notepad++

Is there a way to do this without the intermediate value?

soandos

Posted 2011-11-30T02:10:55.283

Reputation: 22 744

How would you select 2 words to swap at the same time? I think beyond that, some VBA might do the trick. – jonsca – 2011-11-30T02:21:40.690

Well if I were programming it (and I do not want to have to call a separate program to do this) I would parse by the word, and test if it matches one of the ones that I want to swap. If it does, make it the other one. Its easy to program, and far more efficient than my current way in these programs. I would like to avoid a VBA solution if possible. – soandos – 2011-11-30T02:36:38.157

I'm not sure how you would do it without a separate program or VBA (I'm not sure about the macro capabilities of N++). Good idea at any rate. – jonsca – 2011-11-30T02:41:54.130

There is not options to do it, or other program where this is possible? – soandos – 2011-11-30T02:49:43.097

No answers