- AuthorPosts
- May 12, 2008 at 8:03 pm #5771prashob12Member
Hello:
Please help me to create a macro:
I want to delete the follwoing:
(<[^>]+>){1,20} (empty elements)but there is a condition i want to delete the above only when it comes in the following parent element i.e..
….
For e.g.
BUNDESARBEITSGERICHT
URTEIL
The above should apply to all the XML files in a particular path.
Thanks in Advance
May 12, 2008 at 11:12 pm #5772prashob12MemberPlease Reply someone can solve this problem & help me out
May 13, 2008 at 5:05 am #5774Yutaka EmuraKeymasterprashob12 wrote:
Hello:Please help me to create a macro:
I want to delete the follwoing:
(]+>){1,20} (empty elements)
but there is a condition i want to delete the above only when it comes in the following parent element i.e..
….
For e.g.
BUNDESARBEITSGERICHT
URTEILThe above should apply to all the XML files in a particular path.
Thanks in Advance
Go to Customize > Search tab, and check “Regular Expressions Can Match New Line Characters”, and set “Additional Lines to Search for Regular Expressions” to 10.
Find:
(.*?)(]+>){1,20}(.*?)Replace with:
13May 13, 2008 at 9:00 pm #5775prashob12MemberThanks a lot for replying
I tried what u told, but the number of Empty elements present in the is many, so if i use the replacment option it deletes one instance at a time, and the number of files with such instances are also many, so it will be time consuming.
I created a macro to replace all empty elements in at one go:
document.selection.Find(“”,eeFindNext | eeFindReplaceRegExp);
document.selection.CharLeft(false,1);
editor.ExecuteCommandByID(4153);
document.selection.Find(“”,eeFindNext | eeFindReplaceRegExp);
document.selection.Replace(“(]+>){1,20}”,””,eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace(“”,””,eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
document.selection.CharRight(false,1);But i dont know how to make it run on all the files.
There are 1000’s of such files.Thanks in Advance!!
May 14, 2008 at 5:59 am #5776Yutaka EmuraKeymasterprashob12 wrote:
Thanks a lot for replyingI tried what u told, but the number of Empty elements present in the is many, so if i use the replacment option it deletes one instance at a time, and the number of files with such instances are also many, so it will be time consuming.
I created a macro to replace all empty elements in at one go:
document.selection.Find(“”,eeFindNext | eeFindReplaceRegExp);
document.selection.CharLeft(false,1);
editor.ExecuteCommandByID(4153);
document.selection.Find(“”,eeFindNext | eeFindReplaceRegExp);
document.selection.Replace(“(]+>){1,20}”,””,eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
document.selection.Replace(“”,””,eeFindNext | eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
document.selection.CharRight(false,1);But i dont know how to make it run on all the files.
There are 1000’s of such files.Thanks in Advance!!
If you have so many files, how about ReplaceInFiles Method (Editor object)?
- AuthorPosts
- You must be logged in to reply to this topic.