find and replace

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

find and replace

Post by DurtyMat »

If I wanted to remove all of my picture captions with the style p.piccaption how can i remove the start tag, contents, and end tags using the find and replace functionality of flare :D
Flare: I bought it ... so that means I can break it, right?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: find and replace

Post by LTinker68 »

You'd have to use regular expressions so that it'll basically delete the entire tag set, no matter what text is between the opening and closing tags. Unfortunately, I don't know enough about regular expressions to know how to format that, but if you Google you'll find some examples that you can pattern after. (Might want to make a backup of the project first, just to be safe.)
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

Re: find and replace

Post by DurtyMat »

thanks, I will look into some things :D
Flare: I bought it ... so that means I can break it, right?
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: find and replace

Post by NorthEast »

You can also use wildcards.

In the options bit...
1. Set the Find in to whole project.
2. Tick Use and select Wildcards.
3. Tick Find in source code.
4. Then search for <p class="piccaption">*</p> and replace it with nothing.

Job done.
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

Re: find and replace

Post by DurtyMat »

dave,

this is the caption code:

Code: Select all

<p class="piccaption" MadCap:conditions="scc_tc.PrintOnly" MadCap:autonum=" Figure 1-1: ">insert caption text</p>
when i search using your suggestion

Code: Select all

<p class="piccaption" MadCap:conditions="scc_tc.PrintOnly" MadCap:autonum=" Figure 1-1: ">*</p>
i dont get any results. any ideas?

i'm removing the auto number part of the code, because that can cause issues with multiple images in a topic but that doesnt explain why the first image on every topic isnt being found

/cry
Flare: I bought it ... so that means I can break it, right?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: find and replace

Post by KevinDAmery »

Did you turn on the "Use Wildcards" option? (It's off by default iirc)
Until next time....
Image
Kevin Amery
Certified MAD for Flare
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: find and replace

Post by NorthEast »

Ah, scratch that idea.
I just tried out that option to see if it worked, and I entered <p>*</p> - which seemed to work fine and pick up a paragraph tag in my topic.
The trouble is, that only works if the wildcard section (*) does not include any spaces, which obviously isn't terribly useful. Sorry.
forfear
Propellus Maximus
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: find and replace

Post by forfear »

get a full regular expression tool.

do a project backup.

on the website,
Get the following tool
http://www.regular-expressions.info/regexbuddy.html


See how to Grab HTML tags.

http://www.regular-expressions.info/examples.html

i've done this before. and I've hit the same wall with the built in Find/Replace. That's why I know. Unless new features have been added.
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
DurtyMat
Sr. Propeller Head
Posts: 224
Joined: Wed Aug 22, 2007 8:09 am
Location: ClrH2o, Fl

Re: find and replace

Post by DurtyMat »

hoooray, forfear comes through in the clutch! i'll give it a try. :D
Flare: I bought it ... so that means I can break it, right?
mwainer
Jr. Propeller Head
Posts: 8
Joined: Fri Oct 16, 2009 10:08 am

Re: find and replace

Post by mwainer »

Maybe someone can help :D .

I'm using Flare 4.3.1 and I want to find and replace text on either side of a program title that could be anything. I attempted using regular expressions and wildcards in the Find and Replace, but I'm obviously not doing anything right because Flare replaces the title name with the expression. I've searched the regular expressions Web sites offered in the forums, but can't seem to find what I want or understand how to translate what I see to my issue.

What I want to do is this:

I want to replace the text string "The AR Summary Report program allows you to" with "Use the AR Summary Report program to"
BUT, because the program name could be anything, I essentially want to express it as find "The ? program allows you to" and replace it with "Use the ? program to" but I can't get the right syntax for finding and then replacing the text - I really do NOT want to replace the program name with a question mark, asterisk, or any other symbol. I thought I knew how, but was mistaken. Sigh. :?

Thanks in advance!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: find and replace

Post by LTinker68 »

I can't help you with the regular expression itself, but I wanted to point out -- if you didn't see it -- that in the Find and Replace pane, you have to enable the "Use" field at the bottom of the pane and switch its drop-down box "Regular Expressions". (The previous steps above mentioned selecting wildcards.) Did you do that before trying to do your find and replace? Or are you using a tool other than Flare to do the find and replace?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: find and replace

Post by NorthEast »

I can't help with using regular expressions (I never got my head round them); but I can recommend FAR HTML, I use it for a lot of jobs like this.
http://helpware.net/FAR/ (it's free for 30 days or so)
mwainer
Jr. Propeller Head
Posts: 8
Joined: Fri Oct 16, 2009 10:08 am

Re: find and replace

Post by mwainer »

Yes, Lisa, I did select Regular Expressions too. I missed that part in my explanation, sorry. I tried everything and having a weekend to think about it didn't unlock what I had in my head.
Dave, I will try that link and see how that process works.

Thank you both!

Michelle :lol:
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: find and replace

Post by i-tietz »

IMPORTANT:
You can find using regular expressions, but you cannot replace ... at least not in Flare.
You will definitely need an external tool to do that. I had to find out a few months ago and DID use an external tool.

An I also posted an enhancement request - maybe you should do that too: https://www.madcapsoftware.com/bugs/submit.aspx
hoser
Jr. Propeller Head
Posts: 7
Joined: Fri Jan 07, 2011 12:18 pm

Re: find and replace

Post by hoser »

Thanks i-tietz, I wish I had known this an hour ago. I just wasted 30 minutes trying to search/replace using a regex. The help not only fails to tell you this won't work, it doesn't tell you what regex dialect is used, so you end up trying various MS/Posix/Perl combinations. I did just file an enhancement request.
Post Reply