Page 1 of 1

Searching for a range

Posted: Fri Mar 19, 2004 4:42 am
by Garren
Is there a way to search for range and reorder it. I have an HTML file that looks like the following:

<h4 id= "Command String">Command String</h4>
<p>more stuff in here</p>
<p>more info</p>

<h4 id= "Function">Function</h4>
<p>stuff in here</p>
<p>more stuff</p>

<h4 id= "Comments">Comments</h4>
<p>more comments</p>


Now I have 400 files that have the that same format. And I want to be able to rearange so Comments is first, then Command String, then Function. I need a way to select the entire Command String section and move it below Comments.

First, is there a way to select a section. Basically select <h4 id="Function... until the next <h4 is found. Put this in a variable and spit it out in the order I want.

Thanks for any help.
Garren

Posted: Fri Mar 19, 2004 2:20 pm
by DataMystic Support
Yes - use a pattern match like this:

(<h4 id= "Command String">Command String</h4>
.*)
(<h4 id= "Function">Function</h4>
.*)
(<h4 id= "Comments">Comments</h4>
.*)
(<h4)

Replace with

$3$2$1$4

Posted: Tue Mar 23, 2004 3:45 am
by Garren
That is great. This works for most of my files. But it doesn't work for files that have a lot description text below one of the headings. I was able to track it down and if there is more than 6386 bytes of text it will not work. Is there a way to increase the size of that buffer?
Garren

Posted: Tue Mar 23, 2004 4:14 am
by Garren
I figured it out - the button next to the pattern combo box lets you set some of the settings.
Garren