bulk remove row tag
-
Hi, how can i remove a lot rows with this tag?
<category domain=“post_tag” … </category>
from a file xml
what’s the syntax for variable texts? into search box
Thank you
-
Hello Jake1191,
You don’t tell us, in your post, if you prefer :
-
(A) Remove all lines containing, exactly, the string
<category domain="post_tag"......</category> -
(B) Remove the string
^<category domain="post_tag"......</category>from all the lines, containing that string -
(C) Remove ANY line, containing the string
<category domain="post_tag"......</category>, as the line, below :Some possible text BEFORE <category domain=“post_tag” …</category> Some possible text AFTER
Anyway, there’s a solution, with a search regular expression, for each of them :-) Note that, for any of them, the replacement zone must be EMPTY!
So :
For case (A), use the search regex
(?-is)^<category domain="post_tag".+</category>\RFor case (B), use the search regex
(?-is)<category domain="post_tag".+</category>For case (C), use the search regex
(?-is)^.*<category domain="post_tag".+</category>.*\R?
NOTES :
-
Of course, the Regular expression search mode must have been set, previously
-
These 3 regexes begin with the in-line modifiers
(?-is)which ensures you that the search is done, in a sensitive way and that the dot.meta-character will match standard characters, only ! -
As usual, the
\Rsyntax is a shortened form for matching any kind of EOL characters (\r\nor\nor\r) -
In the first case, the string
<category domain="post_tag" … </category>is bounded to beginning of line^and to its EOL characters, which have to be taken in account, to delete the complete line -
In the third case, the string
<category domain="post_tag" … </category>is preceded, from beginning of line, by any range, even null, of standard characters and followed by any range, too, even null, of standard characters, then generally followed by its EOL characters, -
The
?, after\Rmeans 0 or 1 time the EOL character(s) , just in case the very last line which would end, without any EOL character ! -
In all cases, the search match is removed, because there’s NO replacement regex !
Best Regards,
guy038
-
-
hi,
i must remove all the rows where there is the category’s tag.
Because there are thousands of lines style:
<category domain=“post_tag” nicename=“ambiente”><![CDATA[Ambiente]]></category>
but the “domain” must be “post_tag” , there are other values for “domain” that don’t must be removed.ps: I apologize for my english
-
Hi, Jake1191,
From what you said, I think that my solution (C) does exactly what you would like to !
Indeed, any line, which contains the domain attribute, with a value different from the string post_tag, will NOT be removed :-)
Cheers,
guy038
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login