GREP to change paragraph style?

Many people, I have a one for all what you out there smart people. I think GREP can be used to change the formatting in the next instance, but I have no idea how set up.

I have a very long document, essentially a telephone directory of type list of names, telephone numbers, addresses, well over 150 pages. Paragraph styles are fairly simple, two only by registration. The name/phone number is "BOLD", with a tab on the right points pointing to a phone number that is aligned to the right of the column. The following lines are at the same level on the left, not fat, but indented 6pts. I placed the text file and assigned the NameListing paragraph style to the whole thing. I would like to use GREP to find lines of addresses and change the paragraph style NameListingAddress.

Here's a screenshot to give you an idea of screen. The left column is correctly formatted with both styles, the right column is "raw", all paragraphs formatted with the paragraph style NameListing.

What is an application suitable for GREP? If so, how I set it up to only change paragraphs who "do not have tabs? It would save me a crapload of time.

Screen shot 2011-11-15 at 8.10.43 AM.png

THANKS again! -Dina

The easy way would be to do the reverse of what you're trying: together all the paragraphs of your NameListingAddress style (rather than NameListing). And then do a plain old ordinary search for tabs, do not put anything in the line of "change of...". "(or put another tab in) but the value of change in Format to the NameListing style paragraph in the context menu. Change (after you have checked some of them to make sure it's doing what you want).

It is probably a way to do this with GREP, but it would be much more difficult.

Tags: InDesign

Similar Questions

  • GREP for changing the style of paragraphs ending with '='

    Hi, I work with a giant list of the names and dates of graduation. Each line ends with a space and an equal sign must have a special paragraph applied to her style. Is it possible to design a "find/replace" for this, instead of manually? I can't understand what would work the GREP search string - I've never worked with him before, and I can't find anything in the lists of the metacharacters that would do the trick. Any ideas?

    In find it on the field just type = $ ( means hit the bar to type a space). The $ at the end means the end of a paragraph, so he could find no instance anywere elsewhere in a paragraph, which is the only reason why you have to GREP for that instead of a search of plain text.

    Set the paragraph style that you need in the form of the change.

    It works only if it IS indeed the end of a paragraph, however. If you have several lines in the same paragraph that ends with =, or more text in the paragraph after the =, you need to show us the structure. Don't forget that the paragraphs can have style single paragraph, applied to the whole paragraph. If you need several styles in the same paragraph, you need to use character styles, which can be applied as nested styles, line styles and GREP styles, or manually, depending on the structure of the text, you have to work with.

  • Use GREP to apply paragraph styles, character styles not only

    I have a body of text, and in it, I would like to apply a specific style to the paragraphs corresponding to a model. I did a GREP style that applied some changes formatting of paragraphs, I tried that it affects, but in doing so, I found that I couldn't Center these lines using a character style. (The corresponding lines should be centered, and the rest should be left aligned.)

    I was thrilled to learn that the GREP function, then completely disappointed with this limitation. InDesign offers the possibility to automate this, so I must not cross and Center each paragraph corresponding to the hand?

    Thank you!

    InDesign provides a way to automate this so?

    Yes and no. There is no dynamically linked paragraph styles to a paragraph about his boss, but he has at least two alternatives:

    (1) use Grep-F/C

    (2) use the script FindChangeByList or MultiFindChange which is basically automate operations F/C

    HTH

    Loïc

  • GREP find/replace + paragraph Styles

    Hello

    I'm editing a long document and have benefited from the assistance of the community already, but being new GREP Style, find/replace, I need to ask for additional help.

    Below a screenshot of the script (original). Two blocks of text you see anticipated by the icons have have styles of different paragraphs. Icons are placed like custom glyphs.

    Now, the last line with C2, 9, 14,... is the target of this post. They are buses of London and I created a paragraph with another icon. The copy that I work with unfortunately is as you see. Buses will follow «;»

    Resulting to place a \r after the semicolon and assign the new paragraph style. The item to work with is (probably) the last "," before the registration of the bus. All entries have it in the same way, where a search/replace global grep should work fine.

    My attempts:

    I used of a previous debate (? < =------;)) [^ ;] + $ to match everything from the end until the last semicolon, but then I found the problem preserving the matched characters and placing \r (using the (? < =-;). start at the beginning and stops at each point comma + space)

    So question: how to stop at the first semicolon at the end and replace the space with \r to create a new paragraph?

    Then, it is two question :-)

    From my previous attempts, I noticed that when you replace the semicolon + space with \r, and change the style of paragraph at a time (from Rail to Bus) caused the Rail paragraph style change (logic) to the style of Bus. So I tried to say the paragraph style of the track "Following paragraph Style is style of Bus" (and not to change the paragraph style in find/replace), but in a way that no longer works.

    Second question is: given to split the find/replace in two steps, how then transform / apply to newly created paragraph the correct style of Bus?

    Thank you in advance for your valuable assistance. So far, the community has been great!

    Antonio

    Original

    Screen Shot 2016-07-12 at 22.32.23.png

    Result for

    Screen Shot 2016-07-12 at 22.54.51.png

    Hi Antonio,.

    If I understand correctly, in 2 regex [1 click play with Multi/find-replace our friend Martinho da Gloria]:

  • I can target fat with GREP - in dialog paragraph styles?

    Hello.

    I have a number of paragraphs which are mainly "regular" (as the font style: ordinary) but they also have a few bold throughout.

    I'm doing a paragraph style that will apply a character style to text bold using GREP.

    Is there a GREP code for this (to not apply the character for the "BOLD" style and nothing else)?

    I know it's easy to do in the Find/Replace dialog box, but I wonder about the paragraph style dialog box in the GREP section.

    Any help would be greatly appreciated.

    Hello

    Indeed, it is easy to do.

    You do not have to use GREP, you can use the query to search/replace text.

    Start by creating your character for "BOLD" style. (Let's call it "CBold")

    Then create your paragraph style, with your desired settings (let's call it "PReg")

    Finally, click on search it icon 'specify attributes to find', 'Bold' and replace it with character styles and paragraph previously defined:

    Who will do the job.

    Please note that this "erases" all text attributes (for example, italic...) in your paragraph.

    Also, it will apply changes to paragraph all if no style is specified in the search for options: including securities i.e.

    So, be careful when you use this method...

  • Self-propagating ampersands in GREP in a paragraph style

    Hello. I use GREPs in paragraph styles (InDesign CS6) the color of specific words and struck a strange thing, when the words I'm trying to color include an ampersand (&).

    The style works fine the first time, but if I call the paragraph style, and extra sales begins to appear in the GREP expression, not only to the expression, I am changing, but other expressions that include an ampersand as well.

    Example: I enter track ^(?i)------& field

    The next time I have change a grep in this style, the grep goes to the track to ^(?i)------& & field. ^(? (I) then track------& & & field.

    If I go out the extra mostapha, only to see them back. And have a space or not having not spaces on each side of the ampersand does not work

    impact on the problem. I tried to use \s instead of space, but it makes no difference. I also tried dumping my InDesign preferences and export the document as a file .idml in an effort to clear all funky.

    ampersand1.jpgampersand2.jpg

    Has anyone seen this? Thank you!

    Kelly

    Sorry, I have never seen it before.

    A vague assumption: many styles with Grep?

    But maybe you try this instead:

    (? i) a\x e {26}

  • GREP find the paragraph style

    Hi guys,.

    I use this grep to search for all words that use the body text paragraph style.

    However, I get the same result if I specify a paragraph style to find or not.

    The result is always the same. Why is this?

    app.findGrepPreferences = null;

    var found = app.findGrepPreferences.findWhat = "\\b\\w+?\\b";

    found.appliedParagraphStyle = "Body text";

    Found = App.activeDocument.findGrep ();

    Alert ("this document has" + found.length + "words");

    gives the same result as

    app.findGrepPreferences = null;

    var found = app.findGrepPreferences.findWhat = "\\b\\w+?\\b";

    Found = App.activeDocument.findGrep ();

    Alert ("this document has" + found.length + "words");

    app.findGrepPreferences=null;
    var found = app.findGrepPreferences.findWhat="\\b\\w+?\\b";
    app.findGrepPreferences.appliedParagraphStyle=app.activeDocument.paragraphStyleGroups.item("body").paragraphStyles.item("Body text");
    found=app.activeDocument.findGrep();
    alert("This document has "+found.length+" words");
    

    (^/)

  • InDesign CS6 crashing when you try to change paragraph styles

    I'm under InDesign CS6 8.0.1 on a MacBook Pro running OSX 10.8.2

    Whenever I double click a paragraph style to try to change it, InDesign freezes and won't let me leave. When I try to quit smoking by using the menu in now and clicking on the InDesign icon in my dock I get error message saying that "cannot handle request a dialogue model or alert is inactive.» Then I have to force quit. On the revival of demand all my personal creative return to default values (space, typography, etc.)

    I don't know if this is related, but I found at random a .idms file on my desktop today still. Not sure where it belongs or it comes. (Snippet_30719E70D.idms)

    Any help would be greatly appreciated!

    The error seems to indicate that the edit style dialog box is open, but not visible. Try closing or relocation of some windows, if you can.

  • Style GREP in the paragraph style

    I am wanting to create a GREP style that uses a character style. Whenever certain words (no classes) appear followed by dates. Sometimes, it's a unique and sometimes more than one date. For example:

    No class 7/11.

    No class 7/11-8/11.

    What I have so far is:

    No class \d+.

    It works very well through the words 'No class' and the first digit, but not for the whole sentence. I tried different combinations, but nothing works.

    Can anyone help?

    Jay

    The first expression grep in your screenshot does not work because you have added / /, which I should have mentioned should be omitted (including all spaces preceding) - sorry about that. It should read this:

    No class\s [-\d /] +.

    The hyphen is necessary to match the dates like 7/11-8/11.

    As the level of positions with dates and parental guidance optionally, this one works on your example:

    \d[-\d\. My] + [my] (, demands. +)?

    which is a little more secure that Reese, it's because it requires that the date ends in M or y. The? Suite (, requires) makes between it brackets in option. Remember that grep is case-sensitive: If your months can be tiny m thus, use [-\d\.] MMY] for your character class. You may need to tighten the grep to match the dates according to the formats possible.

    Peter

  • Change the paragraphs found in the standard paragraph style?

    I have look here for about an hour and could not find a discussion for this.  I see where it clears the substitutions but not change Style all together.  Here's what I need help do.  If I left saying text 4 selected boxes, I want the power to change the standard paragraph to paragraph and character set to None style style. If there is already can a discussion that I missed in this regard you point me in that direction.  If this is not the case, can I please help with this.

    You can usetpk1982of script to change all the paragraphs of the standard paragraph. But if you only want the block of selected text, then you will need to adjust thescript to change paragraph styles in the selected text frames.

    basically replace line 2 by var allTFrames = app.selection;
    Also, if you need to clear character styles need to do before you change the paragraph style or character styles will be removed and the formatting will be left as a local override.  Your final script after that these changes would be:

    myDoc var = app.activeDocument;

    var myTFrames = app.selection;

    for (var i = 0; i)< mytframes.length;="" i++)="">

    var tFrame = myTFrames [i];

    pStory var = tFrame.parentStory;

    var allParas = pStory.paragraphs.everyItem ();

    pStory.characters.everyItem () .appliedCharacterStyle = app.activeDocument.characterStyles [0];

    allParas.appliedParagraphStyle = app.activeDocument.paragraphStyles [1];

    }

    Note: instead of simply replacing the 2 wire I also changed the name of the variable to reflect rather than leave it in the form allTFrames; and add line 7... Other than these two changes everything was the script of tpk1982

  • Change the Format of a paragraph Style Figure

    I work in Adobe InDesign 6.0 (PC) on a Dell laptop.

    I copied the text from a file and placed it in another file. Unfortunately, the figure numbers all State the former chapter number (in this instance, "6-#" as 6-1, 6-2, etc.). What I want to do is for the numbers to tell 8-1, 8-2, etc., because they are now in Chapter 8.

    I found this much: according to the style of paragraph to these figures, I right-click and select 'change {paragraph Style name} '. Ok. Then in the window that opens, 'Paragraph Style Options', select "Bullets and numbers" in the left menu. Ok.

    Now, here's my problem. I believe that the key to the entire mystery to be included in the section entitled "Style numbering." Yet, I can not Flip off the fields presented here. They include:

    Format: I guess that's the numbering style I want. Currently it says «1, 2, 3, 4...» I left that alone.

    Number: This field contains "Figure ^.» ^ H ^ = ^ # ». What is with the 'H' and all the symbols of hat and all that? What do I need to let him say so that my numbers read "Figure 8-1", "Figure 8-2" and so on? . "

    Style of characters: What am I doing here?

    Mode: What am I doing here?

    Any help would be sincerely appreciated!

    -Shadow

    "What am I doing here?"

    Visit the help, for example. In the list of topics on http://help.adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6da6a.html , I see all your problems listed as subpoints.

    (How I did not know where to find the page? Google "indesign cs4 numbering style" and, thus, it was the first hit. And the next hit points to the book Type Real World Adobe InDesign CS4 , I bet it is also a good resource.)

  • Paragraph styles are ignored by InDesign

    I use InDesign CS4.  My changes paragraph styles are ignored by InDesign.  All the font changes are ignored and everything is "BOLD".  This just started happening.  I tried to uninstall and reinstall.

    Can someone help me?

    Looks like you've applied a style of bold text in addition to the paragraph style.

    Check the character Styles Panel. It is not rare to accidentally set a default character style by selecting with any selected text. When no text is selected, the character Style must be [none].

  • In a paragraph style, is it possible to automatically change a space in the area of district using GREP sty

    I create a menu template that will be used by my client. I'm using a font that has a very wide space between the two words. I can combined a quarter space instead of a regular space between words. This works for me, but won't work for the customer.

    If I create a paragraph style, is it possible to use GREP to automatically change the space in the area of district? and if so, what this text GREP would look like?

    Jump_Over, that did the trick! I'm just starting to learn more about the power of GREP in indesign and have still a long way to go.

    Thanks for your help!

  • import the grep styles in more than a paragraph style

    Hello

    First of all, I must say that I have no experience in scripting. I do not create scripts, simply use the.

    I have a script that imports a paragraph style grep styles to another (in the same document). Whenever I use it, I have to change the script, captures the source paragraph styles and target in this piece of code:

    source = "origem";

    target = "alvo";

    What happens is that sometimes I need to do this lots of times (especially when the updating of old projects). Is it possible to import styles grep for more than a paragraph at the same time, listing multiple targets?

    Thank you!

    Sorry,

    the variable 'source' changed during execution of the script old th. Don't have a close enough look...

    Please replace:

    function setGrepStyle(){
    var target = arguments[0].toString();
    error = "";
     basePStyle = theDoc.paragraphStyles.item(source);
    if (!basePStyle.isValid) error = 'Source style does not exist';
     var target = theDoc.paragraphStyles.itemByName(target);
     if (!target.isValid) error += '\rTarget style does not exist';
     if (error != ""){alert (error); exit()}
      gs = basePStyle.nestedGrepStyles;
     for (i = 0; i < gs.length; i++)
            target.nestedGrepStyles.add (gs[i].properties);
            }
    

    Work here, if this does not work on your machine, I'll write a new piece to add to the SNA nestedGrepStyles ship off the doScript is not really necessary...

  • Fonts change in between two InDesign Documents different paragraph styles.

    When I import a page of a document into another. The fonts in the paragraph styles change. They shouldn't because both documents use the exact paragraph styles and fonts. !

    This is what happens, the changes are there is one applied named style that is not the same between the two.  It could be that basic paragraph Style is defined differently (if all models are based on it), or it could be a character style.

Maybe you are looking for

  • video software for NEX 5N?

    The video software provided by Sony is not compatible with Macs. Can anyone recommend an appropriate software? I'm assuming that iMovie, but I never did anything with the video before. Thank you

  • Stuck with the location of the store, help!

    My store of the App Store is defined in India because I was looking for a game and he said that it was not available in the United States. Stupidly, I clicked on change store. Now, I can't change it because I have $0,25 USD.

  • Removing a CD from a Satellite S1400-253 s drive

    Can someone tell me how to remove the CD drive on my laptop S1400-253 s. The computer is not under warranty.Thank you.

  • TD230 embedded RAID, several bays?

    I use the controller RAID LSI embedded on board is equipped of connectors for 4 hard drives. I initially configured this server with a RAID1 mirror consisting of 2 hard drives, the operating system installed and put into production. Now the customer

  • Create a directory

    Hello How can I create a new directory in windows automatically? Thank you 2 sec.