Edit just one ocurrence in all files, not all ocurrences in all files.
-
@Terry-R said in Edit just one ocurrence in all files, not all ocurrences in all files.:
(?-s)(.?)\x20(?s)(.)
Thanks man, it worked, sorry if i’m being greedy, but, can you make it place the “{” in just one click? If it’s not much the trouble.
-
@Terry-R said in Edit just one ocurrence in all files, not all ocurrences in all files.:
Find What:(?-s)(.?)\x20(?s)(.)
I wish to revise that as a bit more thought revealed an issue. In fact the above regex will find the first occurrence of a blank space, regardless of which line it is. To anchor it to the first line I changed it to be
Find What:(?-s)\A(.*?)\x20(?s)(.*)
For the question in this thread the first regex would still perform correctly as OP stated there was a blank space in the first line of every file.
Terry -
@D-A-G-13 said in Edit just one ocurrence in all files, not all ocurrences in all files.:
but, can you make it place the “{”
Can you provide an example. I don’t understand the question. Are you wanting to replace the blank space with the “{” or insert this somewhere (else)?
Terry
-
For example, it anchors it of the beginning to the text, but i have to press the replace button several times for it, if you could make it to attach it in one click would be nice
-
@D-A-G-13 said in Edit just one ocurrence in all files, not all ocurrences in all files.:
but i have to press the replace button several times for it,
Are you pressing the “Replace All in All Opened Documents” button. This WILL make a replacement in ALL OPENED files within Notepad++.
Terry
-
Yes, but i moves just one space per click until it reaches the beginning of the file, i’m looking to make it reach the beginning in just one click.
-
@D-A-G-13 said in Edit just one ocurrence in all files, not all ocurrences in all files.:
is there any way to edit just one ocurrence in all the opened files instead of all the ocurrences in all files?
This was your original question. You then followed that up with
“is there a way to delete that space of the line 1 in all the opened files?”
The solution removes the first occurrence of a blank space in all opened files if the blank space occurs on line 1.So if the solution does NOT meet your needs I think you need to explain more. Perhaps use some examples. Insert examples, then select them and click on the
</>
button immediately above the posting window. This will prevent the posting engine from changing any example text.
At the moment I’m confused as to your request and the closest I can see is that you want the first occurrence on every line of a blank space to be replaced???Terry
-
@D-A-G-13 said in Edit just one ocurrence in all files, not all ocurrences in all files.:
but i moves just one space per click until it reaches the beginning of the file
Oh hang on. Do you mean some of the files have more than 1 blank space together that you need to remove. If so then please use the 2nd regex (that has the
\A
in it) and change the\x20
to\x20+
. This will select multiple blank spaces together and therefore removes them in 1 click.Terry
-
@Terry-R It worked perfectly, thanks a lot man, you’re my hero.
-
@D-A-G-13 said in Edit just one ocurrence in all files, not all ocurrences in all files.:
It worked perfectly,
I’m glad we got there eventually. It was hard work though.
If you ask any further questions please do supply examples. If the data is sensitive (confidential) then alter the data but keep the structure as it originally was. It’s very important that examples as supplied for the very reason as shown in this thread. Presumably English isn’t your primary language as it seems you didn’t understand some of the questions well enough to give complete answers. That’s why examples are very important. Generally about 5 or so lines before and using the same example lines, repeat them showing the result you were expecting to get.
Terry