Searching for a range

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Garren

Searching for a range

Post 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
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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
Garren

Post 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
Garren

Post by Garren »

I figured it out - the button next to the pattern combo box lets you set some of the settings.
Garren
Post Reply