Searching for a range

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Garren

Searching for a range

Postby Garren » Fri Mar 19, 2004 4:42 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Fri Mar 19, 2004 2:20 pm

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
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Garren

Postby Garren » Tue Mar 23, 2004 3:45 am

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

Postby Garren » Tue Mar 23, 2004 4:14 am

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


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 4 guests