I'll be just a little more clear to you, so perhaps you will come up with an answer that makes sense. If you want two words to be swapped, it should be clear to whatever will be doing that, which two words those are. So you could think about the word the cursor is at and the word after that, or before that. Which of these two, or whatever two words when the cursor isn't at any word at all?
I tried to compose a macro that could do the trick, but didn't succeed. The macro didn't record all actions I performed. It seems that the word selecting won't be repeated, so the clipboard's contents won't be changed. This way, it seems to me, it is not possible to do word swapping using a macro.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
this is my phrase with my CursorWord WordToSwapWith and so go on. (before swapping)
this is my phrase with my WordToSwapWith CursorWord and so go on. (swapped words)
What do you want to know about spaces?
I don't understand you.
If you don't know a solution please give other people the possibility to reply.
In all way, thank you for your help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First of all, I am not blocking other readers to reply. So don't start bugging me about that.
Second, only now you finally answer my question about spacing between words and more in general the layout of your text, data or file.
It _seems_ your words are separated only by a single space character. But can you think of one word being the last of a sentence? This would make it harder to separate it from the next space, since you don't want the sentence-ending dot to be swapped as well. Can you understand that?
If your words are always preceded or followed by the same text or words or even (set of) character(s) you could possibly use the advanced Search and Replace Dialog (CTRL+R) for that, using regular expressions. This can make it somewhat easier to replace a "word1 word2" occurrence by "word2 word1", but this depends on distinguishing characteristics of the specific words or text surrounding them. It would be a piece of cake to swap two words that together with the separating space, are the only text on each line.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, you're right. I didn't process the contents or meanings of those words...
If the layout of your file and all sets of words is the same, perhaps it is possible to create a fixed action pattern for that. If all spaces are _only_ separated by a (fixed number of) space(s) or tab(s), you could delete and type these again inside the macro recording.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't know. If you would reply to my remark about the spacing between the words, then perhaps I could come up with a solution. If you only want me to fix all your problems without being specific about things you could answer to, then I guess the answer is indeed no.
So, all you other people reading and not speaking, please help this guy!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Has Npp a possibility to swap words or is there a possibility to use a macro for this?
(I tried it but my macro doesn't work)
No one has an idea how to create such an swap words macro?
Tnx in advance.
That depends... Which two words do you want to swap? Where is your cursor positioned?
The cursor is positioned in the cursurword.
I'll be just a little more clear to you, so perhaps you will come up with an answer that makes sense. If you want two words to be swapped, it should be clear to whatever will be doing that, which two words those are. So you could think about the word the cursor is at and the word after that, or before that. Which of these two, or whatever two words when the cursor isn't at any word at all?
I tried to compose a macro that could do the trick, but didn't succeed. The macro didn't record all actions I performed. It seems that the word selecting won't be repeated, so the clipboard's contents won't be changed. This way, it seems to me, it is not possible to do word swapping using a macro.
I would like to use notepad++ but how
You're asking always the same thing ;)
this is my phrase with my CursorWord WordToSwapWith and so go on. (before swapping)
this is my phrase with my WordToSwapWith CursorWord and so go on. (swapped words)
What do you want to know about spaces?
I don't understand you.
If you don't know a solution please give other people the possibility to reply.
In all way, thank you for your help.
First of all, I am not blocking other readers to reply. So don't start bugging me about that.
Second, only now you finally answer my question about spacing between words and more in general the layout of your text, data or file.
It _seems_ your words are separated only by a single space character. But can you think of one word being the last of a sentence? This would make it harder to separate it from the next space, since you don't want the sentence-ending dot to be swapped as well. Can you understand that?
If your words are always preceded or followed by the same text or words or even (set of) character(s) you could possibly use the advanced Search and Replace Dialog (CTRL+R) for that, using regular expressions. This can make it somewhat easier to replace a "word1 word2" occurrence by "word2 word1", but this depends on distinguishing characteristics of the specific words or text surrounding them. It would be a piece of cake to swap two words that together with the separating space, are the only text on each line.
thank you.
I prefer to create a macro.
I use it many times in ultraedit.
This is my swap words macro in Ultraedit:
InsertMode
ColumnModeOff
HexOff
Clipboard 7
ClearClipboard
StartSelect
SelectWord
Cut
EndSelect
IfCharIs 32
Key DEL
Key Ctrl+RIGHT ARROW
Paste
" "
Else
Paste
EndIf
ClearClipboard
Clipboard 0
CursorWord WordToSwapWith
new situation:
WordToSwapWith CursorWord
Thank you!
1. You didn't tell where your cursor is positioned.
2. You're welcome. Hope that does it for you.
To answer you, just read my above message again.
The word the cursor is at and the word after that (the 4th message)
I tried to compose a macro as well but didn't succeed as well.
Yeah, you're right. I didn't process the contents or meanings of those words...
If the layout of your file and all sets of words is the same, perhaps it is possible to create a fixed action pattern for that. If all spaces are _only_ separated by a (fixed number of) space(s) or tab(s), you could delete and type these again inside the macro recording.
So you have no solution.
Anyone knows how to create such a macro?
I don't know. If you would reply to my remark about the spacing between the words, then perhaps I could come up with a solution. If you only want me to fix all your problems without being specific about things you could answer to, then I guess the answer is indeed no.
So, all you other people reading and not speaking, please help this guy!