Use Grep to change case in a string of two words 2nd

Hi all

I discovered after completing my project that I had made a big boo boo.

I have several (hundreds) 2 Word botanical names of plants which are located after a certain style of title throughout 400 pages.

The first word of the name is already capitalized. It's ok. But the second word must begin with a lowercase letter (instead of a capital letter as there now).

All the names of 2 words are separated by commas.

Any ideas?

Thanks in advance

Lauren

Lauren,

Yes, it's a script. Sorry, I thought that since you had used the scripts before I must not explain, and who turns out to be correct, because you have made the right choice

"No not found corresponding closing brace" certainly means that you forgot the copy of the last line, which has just the closing brace inside. Please add that and try again.

The looks of script for all text formatted with the character style and containing two or more words. It excludes the beginning capital:

(?<>   is a positive postanalyse which means ' match things following a capital, not the capital itself.

\l+ one or more lowercase letters

\s whitespace

. + one or more characters

I think that \l+ should be \l.+, by the way, so please replace the second line of the script with this one:

app.findGrepPreferences.findWhat = /(?<=\u)\l.+\s.+/.source;

Peter

Tags: InDesign

Similar Questions

  • Try to use GREP to truncate the names of some of the words...

    Hello

    I'm trying to find a way to GREP to select all the text strings that looks like this:

    12345678wieawoejfoiaw.jpg

    65434546wieawoejfoiaw.jpg

    23542398wieawoejfoiaw.jpg

    90989098wieawoejfoiaw.jpg

    23234567wieawoejfoiaw.jpg

    24326743wieawoejfoiaw.jpg

    and leave (replace) with just the first 8 numbers each find string.

    I remember something similar awhile back, when I break the type in some parts (such as numbers or characters and then go and get them back for the part to replace it, but I paint a white...)

    None of my friends GREP autour?

    Babs

    Top of me head * but something like this should do the trick.

    Search

    (?<>

    and replace them with nothing. We find everything on a single line that starts with 8 digits but 'brand' only non-digit so paragraph, you can replace safely with nothingness.

    You've probably used a simpler variant before, as

    ^(\d{8}).+$

    Replace with the first expression in parentheses, '$1', but mine should be more favorable to the document because it only removes and needs no more than absolutely necessary tocuh.

    * Holler if it does not work.

  • Change the paragraph of empty line using GREP style

    Hello again... another request GREP if anyone can help!

    How can I change a line of completely empty paragraph (such as those found between the verses in a poem, for example) to a style of different paragraph so I can control the space better use GREP?

    (?<=\r)\r will="" find="" a="" paragraph="" return="" preceded="" by="" a="" paragraph="" return,="" i.e.="" and="" empty="">

  • 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!

  • Add commas to financial numbers using GREP

    Hi all!

    Using InDesign CC for this. This is the type of financial numbers that I do business with - $79605.01 - with more than 4 k that I add commas 1 or 2 according to the number. Final result should look like this - $79,605.01-

    So far, use GREP I in the FIND WHAT box \$[.,\d]+ and he tries to find them.  What am I missing or unable to, is what to put in the CHANGE TO box. I tried to \1$, but it does not work.

    I have need FIND WHAT already because what I have works well. I just need the script so that it will add commas to the appropriate locations. Search Google gave me a lot of answers on how to 'find' the numbers, but missing of course in the Department of "set up".

    No a kind soul help?

    Steph

    Your GREP expression returns the integer, which is not helpful in this case. I'm not all that an expert in complex GREP, but I don't see a way to do this only once with a number of variable length, so if you have cases for 1 and 2 required commas, I think you need two expressions and they need run in the correct order.

    (First of all find \d(?=\d{6}\.\d) and change to $0, which will add the comma to millions, then find \d(?=\d{3}\.\d) and change to $0, to add the comma for thousands. These expressions only work if there is a decimal number

  • GREP find/change - how to change time of uppercase letters to lowercase?

    I'm doing some final, proofreading and correction of the text in a book I helped design.

    I've had some success using GREP find/replace.  But I can't make it work in the following case.

    I want to do is find all occurrences of 'Nature' and change to 'nature '. (Uppercase to lowercase simple substitution.)

    BUT I want to exclude all instances of 'Mother Nature'. (Keep uppercase "n" in Nature.)

    Assistance from Adobe, I should be able to use a negative Lookbehind expression.  I tried to type in the search box... Nature(?<!) The mother)

    But he finds everything... 'nature', 'Nature', 'Mother Nature', which is not much help.

    Can someone please tell me where is my mistake and how to correct?

    Search: (?)

    Replace with: nature

    Peter

  • Price of conversion using GREP

    In InDesign, it is possible to change the American classics price ($00.00) traditional French ($00.00) use GREP?

    I have hundreds of cases in a catalog where I need an easy way this conversion may.

    $0.00 $0.00

    $00.00 to $ 00.00

    $ 000.00 to $ 000.00

    In the hope of a solution.

    Thank you.

    To find

    (\$) (\d+)\. (\d+)

    Implement

    $2, $3 $ 1

  • 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

  • How to track the change case?

    My company is looking to use Adobe illustrator to modify the engineering documents.

    Is there that there is a feature to follow the change case?

    or can do us change list?

    There is no built-in version control. You will need to manually track this info by using appropriate naming conventions, an external database or whatever.

    Mylenium

  • Can I use GREP to transform every fourth tab back?

    I have a huge file with tabs plus 5,000, and only every fourth tab must be changed for a return. Is this possible using GREP or ANY OTHER METHOD and pressing back another me having to manually select each fourth tab?

    This screen is pulled before running GREP? You don't mention he had already returns after the names in some places.

    You need the * after all the [^ \t] elements, but avoids the. +. [^ \t] is a negative class, that means anything that is not a tab, and the * means 0 or more times.

    And you said every fourth tab, so it's actually the tab after the postal code, and which seems to do what you ask. If you want to change the tab after the name on the first line, I this would address differently.

    Find ^(.*?\t.*?) (\t) (?!\(\d{3}\)) which means find any character at the beginning of a paragraph (if there is) followed by a tab and more characters (if there are any), then a followed by three digits in parentheses DO NOT tab, and change $ 1 which should only change the tabs after the names. It is, however to change the tab after the postal code if the following line does not begin with three digits in brackets.

    Looking at the ads, are you sure you want to change this tab for a paragraph, rather than just a forced line break return (you can do by changing to $1\n)? It depends on how your styles are implemented...

  • Adding hyperlinks and text ankles using Grep

    Hi all

    I tried to add both a hyperlink text source and destination within my document using Grep, but I can't seem to do things. I'm looking to find the source text that has the style of paragraph "1HD" and begins with the word 'History', and then turn that into the source text for the hyperlink. Secondly, that the text "References" later to become the anchor of the text to the destination of the link. As a reference, here is what is defined:

    var myHeader = app.findGrepPreferences.appliedParagraphStyle = "1HD";
    var myHeader = app.findGrepPreferences.findWhat = "Historical \w*";
    

    as well as

    var myAnchor = app.findGrepPreferences.appliedParagraphStyle = "";
    var myAnchor = app.findGrepPreferences.findWhat = "References";
    

    I did experiment with information I could get my hands on in line, but I always feel to get an error or another. Any guidance would be greatly appreciated!

    Regards and thanks in advance.

    Julian

    Hi Julian,.

    Can useful code, below

    1 change the line 5 according to the guidelines of your paragraph Style request

    var myDoc = app.activeDocument;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    app.findGrepPreferences.findWhat = ".+";
    app.findGrepPreferences.appliedParagraphStyle = "MN_first";
    var myFound1 = myDoc.findGrep();
    
    count = 0
    for(k=0; k
    

    To anchor text, use the code below:

    var myDoc = app.activeDocument;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    
    app.findGrepPreferences.findWhat = ".+";
    app.findGrepPreferences.appliedParagraphStyle = "MN_first";
    var myFound1 = myDoc.findGrep();
    
    count = 0
    for(k=0; k
    

    Concerning

    Siraj

  • Use GREP

    I have the [0 - 9a - zA - Z] GREP style part of a paragraph style. The paragraph style using an Asian font, and the GREP style changes the English characters to a different font. It works, but the Japanese don't use no spaces (space). I want to add a space before and after the English characters. What I have to add to the GREP style so that whenever a word or an expression is encountered, a space would be added before and after the phrase English - or is this even possible?

    This pink character is because you applied your Western police the last Japanese tank. You need a second character style for my grep that applies to track, for example, a value of 200 or similar. All the fonts related fields should remain empty / unmodified.

    In addition, set all these [A - z] to include all the other Western characters that you meet, for example [A-Za-z0-9] to match your original grep. I was just a little lazy typing because my grep style editor seems broken - no cursor keys. ([A-Za-z0-9](?=[^A-Za-z0-9])) | ([^A-Za-z0-9](?=[A-Za-z0-9]))

    Optionally, use the grep following - he still lacks the accented Western tanks but should cover all the plain English:

    ([[: ascii:]](?=[^[:ascii:]])) |]]) ([^ [: ascii:]](?=[[:ascii:]]))]])

    Grep for the Japanese should not include ascii punctuation characters.

  • 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.

  • Use Grep to find/replace

    I'm trying to find how to use GREP in find/replace of chage the formatting of a text which is a spreadsheet.

    I worked on the GREP query "~ b (\d\d) ~ b ', which is a paragraph return, followed by two digits, followed by another paragraph of return

    and then it is replaced by ' \t $1 ~ b ', which is a tab, found two numbers and a paratrooper returned.

    What I have to do is change the query to search for ANY number of digits, (which may be delimited by commas: e.g. 23, 36, 48, 50), then replace with a tab + found text.

    I guess what I'm looking for is a way for the query find "any text between two paragraph returns, no matter what that length", but I don't know how to do this. All of the generic options seem to find a single exampler (a figure, a character etc.)

    And you came so far

    Repetition operators are? (zero or one), * (zero or more) and + (one or more times). You can also specify the exact number: {at least up to the}.

    All of these operators are "greedy" by default - they match as much as possible. To to match as less as possible (which I'm sure you will come, sooner or later), add another? After the expression of repeat.

    If this is a number, then possibly another (which will be always included):

    \D\d?

    and what a figure, then zero or as much as 9999999,93856 million:

    \D\d*

    which is functionally identical

    \d+

    And it is between 3 and 8 figures but will be forced to use the shortest possible match:

    \d{3,8}?

    Having said that: a quick & dirty solution for your real problem is to find any amount of numbers, spaces, and comma:

    ~ b [\d,] + ~ b

    (there are more here because otherwise it would correspond also to an empty line). The [..] a list of the hooks - it will match to any unique inside code.

    A more complicated but 'cleaner' way is looking very precisely that for many, comma, space, number sequences - it is cleaner because it lines poorly trained (comma without a space) is fried!

    (She also has another code - operators in parentheses. Look at their place in a good reference GREP - lost people are enthusiastic about Peter Kahrel O'Reilly title, because there on the use of GREP in InDesign.)

    ~b\d+(, \d+)*~b)

  • Can I use automator to change the modified time of a file as its content?

    I use automator to rename a series of images.

    The problem is whenever I change a change of time of amending records file.

    Can I use automator to change the modified time of a file as its content?

    I know that I can use the Terminal to change a date but I have no idea how to do to automate this process

    As you say you know the command to use in the Terminal, and then with Automator, use the Action run the Shell Script after the name change.  The new file name will be passed to the Action run a Shell Script, and from there, you can use touch - r to set the time of the file at the time the name of the new file

Maybe you are looking for