Quick way to find characters abutting variables?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Quick way to find characters abutting variables?

Post by Phlawm53 »

Flare 6 evidently provides no straightforward way to quickly locate or search for text characters that abut a variable without an intervening space.

Does anyone know a reliable and SAFE way to use Find-Replace (or any other tool) to search for these instances and fix them? The key point that occasionally I mistype the text so that the text runs into the variable text. When the project is generated, the variable contents and the ensuing text have no intervening space.

This is driving me crazy -- it's forcing me to generate a project as a Word target, then use Word's spell-checker to find typos of the form [A Flare Variable]some topic text, locate the instances in the Flare project, then change them to [A Flare Variable] some topic text. That is, to locate and correct the missing space between the variable and the text.

Cheers & thanks,
Riley

(P.S. Note that above I emphasized a SAFE way to correct these occurrences. I mention this because trying to use Find-Replace to search for instances of two consecutive space characters and replace them with a single space character will delete ALL instances of " [Flare Variable] ". Ouch!)
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Quick way to find characters abutting variables?

Post by Andrew »

The only way I know you might be able to do it is with regular expressions, which I don't know how to use. There are a lot of online resources explaining how to use regex.
Flare v6.1 | Capture 4.0.0
Nita Beck
Senior Propellus Maximus
Posts: 3671
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Quick way to find characters abutting variables?

Post by Nita Beck »

I'm partial to FAR HTML. It's a third-party tool, actually a .chm authoring tool, and it's not very expensive. (It has a per-user license, not a per-machine license so I've got it on all my machines.) I use is solely for its Search-and-Replace functionaliIty. I can build very simple or very complicated search-and-replace rules, including wildcards, to run against my Flare files. Better yet, I can save the search-and-replace routine for easy reuse, which can't be done at all with Flare's Find-and-Replace utility. And even better than that, I can even copy that saved routine to use on a different machine (with FAR HTML installed) or send to my subscontractors (who have FAR HTML).
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Quick way to find characters abutting variables?

Post by Phlawm53 »

Nita:

Thanks -- you planted a seed. I hadn't thought of using a third-party program to parse the contents of the files.

But now that I have, I realize that the jEdit text editor I use for other tasks (http://www.jedit.org/) has extensive search-replace capabilities, including Regex plugins and other utilities; and can operate on entire directories of files. So I might solve my current problem by using jEdit to wade through the HTML looking for instances of variables adjoining non-space characters…

Cheers & thanks 'gain,
Riley
Ken Billing
Propeller Head
Posts: 55
Joined: Mon Dec 17, 2007 11:33 am

Re: Quick way to find characters abutting variables?

Post by Ken Billing »

Try this regular expression:

Name" />[^ <),&.\r\\]

Where Name is the last word of the variable name(s) that you want to find. In my case, all the variables end with the word Name, which makes it easier. But you could also replace it with a matching expression as well.

This particular expression excludes the variable tag followed by spaces, returns, and the characters <),&\ all of which are acceptable in my case.

Hope that helps,
Ken
Ken Billing | Technical Writer
BlueCielo ECM Solutions
http://www.bluecieloecm.com

Image
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Quick way to find characters abutting variables?

Post by Phlawm53 »

Ken: Thanks for that! Cheers, Riley
gfevrier
Propeller Head
Posts: 45
Joined: Thu Jul 30, 2009 12:10 pm
Location: Tampa, Florida
Contact:

Re: Quick way to find characters abutting variables?

Post by gfevrier »

Ken, thank you so much for the regular expression: Name" />[^ <),&.\r\\]
For some reason, there are hundreds of instances in our Flare project where there are missing spaces before and after a variable.
I downloaded the free version of Agent Ransack and followed these steps and it worked! We have a dozen variables, though, and you have to run a separate search for each variable name, but it does work.
1. In Agent Ransack on the Main tab, in the Containing text field, enter the regular expression , substituting Name with the Flare variable name.
2. In the Look in field, enter the path of the Flare project.
3. On the Options tab, in the Contents section, select the Regular Expression check box.
4. Click the Start button.
5. The files containing the problem appear in the left pane. Select a file and the line number and text appear in the right pane.

In my case, the problems are in the htm files. The problem variable and text is highlighted in blue.
So you just have to correct the individual files in Flare.
Gina G. Wadley, M.Ed.
Staff Information Developer
http://www.ifcatscouldwrite.com

"The most valuable of all talents is that of never using two words when one will do." -- Thomas Jefferson
Ken Billing
Propeller Head
Posts: 55
Joined: Mon Dec 17, 2007 11:33 am

Re: Quick way to find characters abutting variables?

Post by Ken Billing »

Glad it helped you. Even still in version 9, Flare has challenges playing nice with variables and spaces. For example, try dragging and copying two variables separated by a space to another place in the text. Flare doesn't copy the second variable (come on, guys!). Copy and paste is more reliable.

Agent Ransack sounds good, but if you'd like to both find and fix problems in your files in one action across many files without opening every one in Flare, check out http://www.digitalvolcano.co.uk/textcrawler.html. It is far and away my favorite tool to use with Flare and has saved me many hours of editing and grief both fixing problems like this one and making wholesale changes across Flare projects. It eliminates the excuse of "It would be a LOT of work."
Ken Billing | Technical Writer
BlueCielo ECM Solutions
http://www.bluecieloecm.com

Image
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Quick way to find characters abutting variables?

Post by Msquared »

The most likely reason why there are dozens of places where you have no space before or after a variable and you didn't spot it is because Flare doesn't flag such instances as spelling errors. If it did, you'd notice them as you typed the text.

I'm getting better at remembering to check each time I insert a variable. But it doesn't come naturally to me as part of my editing workflow and I still pick up far too many instances of this when I proof-read my content. :-(

I raised this as a bug. MadCap decided it was a feature request, so if it matters to you, support me and raise a feature request too.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Quick way to find characters abutting variables?

Post by Phlawm53 »

Msquared wrote:The most likely reason why there are dozens of places where you have no space before or after a variable and you didn't spot it is because Flare doesn't flag such instances as spelling errors. If it did, you'd notice them as you typed the text.
…
I raised this as a bug. MadCap decided it was a feature request, so if it matters to you, support me and raise a feature request too.
I filed this as a bug / feature request back in version 6. And have raised related issues regarding the clumsiness of Flare's spell checker when it comes to handling Flare's own variable constructions.

My most recent Enhancement request, submitted earlier this year (2013), is for a specialized Preview window that would circumvent Flare's dysfunctional in-topics spell checker with spell checking on a gen'ed-as-Preview topic file. No idea where that suggestion has gone to…

Long story short, as of Flare 9 the only truly reliable way I've found to spell check a Flare project is to gen a Word Target and use Word's spell checker. More than a little inefficient; more than a little annoying…

Cheers & Merry / Happy and all that,
Riley
SFO
Psider
Propellus Maximus
Posts: 820
Joined: Wed Jul 06, 2011 1:32 am

Re: Quick way to find characters abutting variables?

Post by Psider »

I'd like to chime in and say that I have seen numerous instances where a space appears after a tag (variable, bold, etc) in the editor, but then does not have a space in the output. I keep meaning to send an example to Madcap, but haven't quite got to it yet. And I haven't figured out what causes it. :S
Amber
Post Reply