How to search for runts, orphans, widows using GREP

Hello,
I've been trying to bust my brains on how to do a search by locating single words at the end of a paragraph and on a single line by themselves. Yes, you guessed it! I'm trying to hunt down those orphans, widows that are sometimes called runts. I just don't want to do it manually and you always seem to miss one or two of them. I'm already using the techniques detailed and discussed in length on how to deal with orphans and widows but we have to hunt them down first...
Here's the closest GREP search I can get:
(\w+)(.)\r^
but this searches for all words at the end of a paragraph regardless of whether or not they are sitting on their own on a single line. I need to pin point on single words on a single line.
Unless of course there's a much easier way than GREP, then by all means do tell..
Using cs4.
Any input would be much appreciated.

Hi Peter
I posted the following in the IndesignSecrets forum and Jongware kindly pointed me at this thread
I'm laying up a 600-odd page book for a client who went to design school some years ago where it was drilled into her that "Thou shalt never ever have an orphan" (she means runt). She is insisting that every last runt in the book be exterminated irrespective of word or line length, rivers created or insane ragging. The book contains a lot of text-wrapped anchored boxes,diagrams, etc so of course, every time there's a copy change these move creating new runts. Instead of proofing for important things like correlation of diagrams with text, etc she is fixated on these runts.
To prevent what little brain I have left from exploding I'd like to write the following Find/Change but have not been able to get the language correct:
Find: Any word preceded by a space and followed by a paragraph mark
Change: the space to a nonbreaking space
Blatner Tools lets me find the runts but they still need changing manually so I've tried your below Find/Change Grep:
Peter Spier wrote:
I don't think it's possible to find only last words alone on the line (except maybe with Blatner Tools, which I've never used). My point was that if you don't want to have a single last word you could do something like find ( )(\w+[[:punct:]])$ (there's a space between the first set of parentheses) and replace with ~S$2 and that will replace the last space in EVERY paragraph with a non-breaking space ...
Unfortunately,I can't quite get the GREP to run properly. It works for plain ordinary paragraphs but for some reason it only works randomly in bullet/numbered lists of which I unfortunately have quite a few. Also, if the last sentence of a paragraph contains a footnote marker (again many of these),  it changes the last word of the actual footnote but not the paragraph which contains the footnote marker.
Are you able to help with a tweak please.
Thanks n cheers, Gobit

Similar Messages

  • How to search for upper/lower case using string using JAVA!!!?

    -I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
    -I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
    -This will be repeated until the user types the word "Stop". 
    please help if you can
    what i have so far:
    [code]
    public class Project0 {
    public static void main(String[] args) {
      String[] uppercase = {'E'};
      String[] lowercase = {'e'};
      String isOrIsNot, inputWord;
      while (true) {
       // This line asks the user for input by popping out a single window
       // with text input
       inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
       if ( inputWord.equals("stop") )
        System.exit(0);
       // if the inputWord is contained within uppercase or
       // lowercase return true
       if (wordIsThere(inputWord, lowercase))
        isOrIsNot = "Number of lower case e's: ";
       if (wordIsThere(inputword, uppercase))
         isOrIsNot = "number of upper case e's: ";
       // Output to a JOptionPane window whether the word is on the list or not
       JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
    } //main
    public static boolean wordIsThere(String findMe, String[] theList) {
      for (int i=0; i<theList.length; ++i) {
       if (findMe.equals(theList[i])) return true;
      return false;
    } // wordIsThere
    } // class Lab4Program1
    [/code]

    So what is your question? Do you get any errors? If so, post them. What doesn't work?
    And crossposted: how to search for upper/lower case using string using JAVA!!!?

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the

    I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the automatically uploading of old material?
    Thanks

    You have 2 unreachable statements in this method.
    public static int eval(String s2, String op, String s3) {
    return lookup(s2);
    return lookup(op);
    return lookup(s3);
    } You're missing a } at the end of this method:
    public static int lookup(String s) {
        for(int k = 0; k < symbols.length; k++){
            String symbol = symbols[k];
            if(s.equals(symbol))
                return k;
        }You have some loose } and ; at the end of the file:
    public static void main(String args[])
    commandline();
    }

  • How to search for the list of portal components that use a certain LOV?

    hi,
    does anyone know how to search for all of those portal components which use a certain other component?
    let's make it specific. how can i know which of the portal components (portal reports and forms, content folders, etc) are using any certain LOV?
    will really appreciate any hints.
    naqvi

    Please ask this question in the Oracle Text forum (formerly interMedia text). You will get the experts that work with it every day there.

  • How to search for a BADI in a transaction

    Hi All,
    Please let me know the steps to find a BADI for a transaction.
    Thanks,
    Jaffer Ali.S

    check this.
    u can find BADI's in different ways...
    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    The simplese way for finding BADI is
    1. chooes Tcode Program & package for that Tcode.
    2. Go to Tcode se18
    3. Press F4
    4. search by package or by program.
    Regards
    Kiran Sure

  • How to search for a Movie?

    I'm looking for the movie "Roots" which lasts probably 12 or 14 hours. I found 'Episode One' in a list with a billion songs called 'roots', but can't find the whole movie for purchase. How do I search for a movie without all the songs included in the list, and is it possible that iTunes doesn't sell the whole movie "Roots" in one fell swoop?

    If you are referring to the show based on Alex Haley's book, it wasn't a movie, it was a TV miniseries and so is multiple episodes and must be purchased as such or as a Season. If you do a Power Search for TV Shows and use Roots in the Show field, you'll find all the episodes. Here's the link to the original series:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?id=255117456&s=14 3441
    and here's Roots: The Next Generation:
    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewTVSeason?id=266395382&s=14 3441
    Regards.

  • How to search for a fields ?

    Hello,
    I know it's an easy question but I've not find, how to search for a fields in Database on CR XI R2 ?
    Thanks in advance

    Hi Alexandre
    Do you want to see which database fields you have inserted in Crystal Reports and in which section you have inserted what fields?
    If yes then
    -open formula editor
    -In the right side pane expand Formatting Formulas.
    -Expand all the sections one by one and it will show you database fields,formulas and all the objects used in the sections.
    Hope this will clarify your doubts.
    Regards
    Asha.

  • How to search for a particular word in a long document?

    How to search for a particular word in a long document?

    What program are you using to read the document?
    Good luck.

  • How to search for a word in an email?

    How to search for a particular word in an email in 'Mail'?

    You can't search through email content using buil-in search
    If you're using Gmail, you can use their native Google Mail app which will allow you to search through body content and server-stored emails.

  • How to search for password policy

    Hello,
    Using DS 5.2:
    I've created a test policy, dn: cn=Test Policy,ou=People, o=xxx, o=isp. I can apply the policy, I can see the policy in my backup ldifs, but I can't figure out how to search for and display it (and eventually, delete it) either from the command line using ldapsearch or form within the admin gui. Any help?

    What I would like to do is query my 8i instance for the current password policy
    Can anyone provide a query to retrieve this info?connect as sys
    in Oracle 8i and issue the command;
    select object_name,object_type from all_objects where object_name like '%PASS%';
    and
    select object_name,object_type from all_objects where object_name like '%POLICY%';
    I think , i'm not sure these policies would be transfered to 10g through migration except -if any- some of them are obsolete to 10g!!!!!
    Regards,
    Simon

  • HT204266 how to search for a specific app eg tetris in the app store?

    Hi is there anyone that can please help me on how to search for a specific app eg tetris in the app store? Thanks

    Hi Friend,
    You just write down the name of the app or for what the app is used for (eg, write down Notes and then will appear a lot of options), then download what you wish.
    Hope it will be helpful

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    I am using IPAD Mini.When I am searching for any particular song or album from my shared ITUNES folder, the search is conducted  in the apple store and not on the shared library. How to search for the song in the shared library

    Search for shared library is impossible, as far as I know.  Searches supported - are local and internet.

  • AMs and PMs - how to search for small-caps?

    In my book I'm proofreading I have a mixture of (because I was undecided when I was putting it together):
    i 7.00 a.m.
    i 7.00 am
    i 7.00am
    I ran these three options past about twenty people this morning, 6 voted for the first, 8 voted for the second, 3 voted for the third, and 1 person and myself voted for the option I can't show properly here: small-caps: 7.00 AM. Then of course there was the wag who told me: "Why don't you just say '7 o'clock in the morning' "? And the complete ratbag who suggested, in the interests of avoiding confusion: "7.00 am o'clock in the morning before lunch at 0700 hours."
    Before I make them all the same format, which will very likely be small-caps, I want to make sure I can easily search for them so I can replace with an alternative style if I change my mind again later on.
    QUES: How do I search for "AM" and "PM" (spaces before and after) if they are formatted in small-caps? I can't use paragraph styles because the AMs and PMs appear in a variety of styles already.

    Thanks for all the hints. I'm going to try some of them to see how they work. I should make it clear though (my original post may have been unclear about this) that I was asking how to search for AM in small caps AFTER I had changed all time-formats to that form.
    As for why I asked for input: I treat my book a bit like a democracy and give people a chance to vote on certain aspects and make comments just in case they have a good idea that I hadn't thought of; but yes, I'm the boss, and in terms of votes mine counts for 95%. In this case, someone suggested using a colon -- which I have taken on board. So I will be using the time format 7:30 AM to see how it looks. But if I don't like it, I want to be able to find all the small-cap AMs and change them to something else in one go.
    My interest in time-formats has stirred some interest locally. My partner proof reads a walking club magazine and she received the latest edition lat night. She has never concerned about time formats before, but after my foray into different options, she came up with the following variety (the club has lots of reports that include times when walking trips start and end), even though she thought she had done a thorough job of proof reading:
    9 am
    9.00am
    9:00 am
    9:00am
    9.am
    9 AM
    9.00a.m.
    9.00 a.m.

Maybe you are looking for