how to delete rows out of multiple files
-
I need to delete all the selected text
[IMAGES REDACTED]
the only thing that should remain is from textxxxxxxxx
until the end linezzzzzzzz
Can anyone help me with this please it really bothers me.
Thank you
-
@holczmann-raul
Your request is confusing.
Follow instructions HERE. -
Hello, @holczmann-raul, @alan-kilborn and All,
Although @alan-kilborn is right about the lack of information, I think I’ve guessed what you want !
So, could you try the following regex S/R against your file ?
SEARCH
(?xs-i) <Ticket\x20 .+? <!\x5B CDATA \x5B ( .+? ) \x5D\x5D> </Content> \R </Ticket> \R?
REPLACE
$1\r\n
or$1\n
with Unix filesUse, either, the
Replace
orReplace All
buttonSee you later !
Best Regards,
guy038
BTW, you said :
Can anyone help me with this please
And add :
it really bothers me
Well, I suppose it’s the same thing for every of us : we all want to find a way to get the job done !!
-
@Alan-Kilborn Thank you for investing your time in my problem.
Unfortunately it deletes every this except the first line, like this.
[IMAGE REDACTED]And i need the selected orange text to remain.
[IMAGE REDACTED]
Fromxxxxxxx
tozzzzzzzz
has to remainThank you
-
Hello, @holczmann-raul, @alan-kilborn and All,
@holczmann-raul :
First of all, it’s not @alan-kilborn which is trying to find out a solution to your problem but @guy038 !!
Now, how do you expect me to modifiy the different pictures that you pasted, with some regexes ?
So, please, when replying in this forum, paste your file contents as text, by clicking on the red icon, below :
Thanks for your cooperation !
See you later !
guy038
-
The moral of the story is, take a glance at the problem that is not presented well, and if there is any aspect that is unclear, do not try to answer, simply refer poster to the FAQ area for how to ask their question properly.
-
Hello @guy038 ,
I replied to the wrong person, sorry. Thank you for taking your time with this problem.
I am trying to wright my problem as clear as I can but my English is not that good.
This is the text I have problems with.
DATA REDACTED
And I would need it to look like this:
DATA REDACTED
I need to do this with ‘Replace All in All Opened Documents’
Thank you and once again sorry for the confusion.
Raul
-
Hello, @holczmann-raul,
Thanks you for this version. It’s perfect !
I’ll be back in about
3
hours !BR
guy038
-
Hi, @holczmann-raul, @alan-kilborn and All,
First of all, sorry for my absence, longer than expected !
But indeed, I do not understand why my previous regex did not work for you ?
Of course, in my previous regex, I kept the very first line :
<?xml version="1.0" encoding="utf-8"?>
But you should had got the correct results !
Thus, here is my second version which deletes the very first line, as well !
So, from the INPUT text :
DATA REDACTED
With the following regex S/R :
SEARCH
(?xs-i) \Q<?xml version="1.0" encoding="utf-8"?>\E \R <Ticket\x20 .+? <!\x5B CDATA \x5B ( .+? ) \x5D\x5D> </Content> \R </Ticket> \R?
REPLACE
$1\r\n
or$1\n
for Unix filesYou should get the expected OUTPUT :
DATA REDACTED
Voila !
Seemingly, you have several
.xml
files, with the same template, all located in a specific folder. and all opened in Notepad++So, the road map is :
-
Backup this folder, preferably
-
Start Notepad++
-
Open all the concerned files
-
Move to the very beginning of one of them
-
Open the
Replace
dialog (Ctrl + H
) -
Untick all box options
-
SEARCH
(?xs-i) \Q<?xml version="1.0" encoding="utf-8"?>\E \R <Ticket\x20 .+? <!\x5B CDATA \x5B ( .+? ) \x5D\x5D> </Content> \R </Ticket> \R?
-
REPLACE
$1\r\n
or$1\n
with Unix files -
Select the
Regular expression
search mode -
Click on the
Replace All
button -
If the result is OK, then click on the
Replace All in All Opened Documents
button -
Click on the
File > Save All
option (Ctrl + Shift + S
, by default )
Note that I assume that the case of the very first line and the strings
<Ticket
,CDATA
,</Content>
and</Ticket>
does not change !If, for instance, the word
CDATA
may be written asCdata
, then change the modifiers, in the first part of the search regex by(?xsi)
Best Regards,
guy038
-
-
Hello @guy038
It worked like a charm! Thank you very much for your time.
-
To future readers of this topic: sorry for the missing information: the original poster deleted their posts because the data they shared had privacy violations.
As a moderator, I restored the posts so there’s still some context for this conversation. But I removed (“redacted”) the original data and screenshots – both from the original poster’s messages and from any replies.
This conversation is mostly meaningless at this point, so there’s not much to learn from. Sorry.
This Topic is now locked.
Moral
The data you share in this forum has to be of the same format and structure as your oringal data, otherwise we cannot help you. But you need to make sure you clean out any private or secret or sensitive information and replace it with meaningless data that has the same structure and form.
-