GREP for changing a character

Hi people,
I have many lists like
a) local,
b) de ZEC y
c) de Región Biogeográfica
d) Escala local, o de estación
how can I change the a and the bracket of this list to Italic with GREP. Can i select just a paragraph like Paragraph Style to apply GREP? I have some fear that if i change all (in a many pages document) it can do some damages.
Maybe there is an easy way to do it...
Any idea?
Thanks and cheers,
Sebastian

Tons of ways. How about a paragraph style with a nested character style, up to the parenthesis or the tab/space after that? That's better than local formatting with italics, which will shows the dreaded '+' sign.
But you were asking about the GREP expression ... How's this? Search:
>^[a-d]\)\s
-- replace with formatting only, italics (or a paragraph style with aforementioned nested char style!).
The GREP meaning, left to right
* '^' = start of paragraph
* '[a-d]' everything from 'a' to 'd', if the lists go further than 'd' just put it there. I advise against blindly writing '[a-z]' --
i just in case.
* '\)' is the closing parenthesis. It has to be escaped with a backslash because parentheses are special characters in GREP search.
* '\s' is any space character -- space, tab, soft return, thin space, etc. If you know for sure you always have a space next, use just that instead! Just enter a space. If you know for sure you always have a tab next, use '\t'. As before, better be safe than sorry.
Hit 'Find next' and 'Change then find next' a couple of times, enough to reassure it isn't finding anything it shouldn't, only then hit 'Change all'.

Similar Messages

  • GREP for changing paragraph style?

    Okay folks, I have another one for all you smart people out there. I think GREP can be used to change formatting in the following instance, but I have no idea how to set it up.
    I have a very long document, essentially a phone book-type listing of names, phone numbers, addresses, well over 150 pages' worth. The paragraph styles are fairly simple, only two per listing. The name/phone number is bold with a right hand tab with leader dots to a phone number that is flush to the right side of the column. The following lines are flush left, not bold, but indented 6pts. I've placed the text file and assigned the entire thing the NameListing paragraph style. I'd like to use GREP to find the address lines and change them to the NameListingAddress paragraph style.
    Here's a screen shot to give you an idea. The left column is formatted correctly with both styles, the right column is "raw", all paragraphs formatted with the NameListing paragraph style.
    Is this an appropriate application for GREP? If so, how do I set it up to only change the paragraphs that "don't have tabs"? It would save me a crapload of time.
    THANKS again! --Dina

    If your intent here is to use the character style to trigger a variable, as I belive it is based on your other thread, you MUST apply the character style up to the first tab to pick up the text at the start of the paragraph. There are two approaches to automating the formatting after that, but it may be too late for you to be much help.
    In cases where every listing has the same number of lines it makes sense to use a unique paragraph style name (not necessarily format -- base on on another) for each lline and make it its own paragraph. Set up "next styles" to rotate through the list so each line is assigned the correct style based on the style of its predecessor. You get the rotation to sart over by making the first line style the next style for the last line. This works for manual entry and can be applied to an entire block of placed text in a single operation by selecting the text, then right-clicking the name of the first style to be applied and choose Apply <stylename>, Then Next Style.This ONLY works if you have exactly the same number of paragraphs in each listing.
    The other option is to use forced line breaks instread of paragraphs and use one style for the entire listing. Set a left indent and negative first line indent, create a character style for the part of the first line that you want to appear in your header and apply it Up To ^t^n (that's a little-known trick -- if you enter more than one character in the trigger for a nested style it will activate on the first instance of any of the characters listed that occurs, so for example if you enter the word cat, your style will end on the first, c, a or t that appears inthe paragraph. ^t is the metacharacter for tab, and ^n is for forced line break) so that the style will end at either the tab, if present, or the forced line break if there is no tab (if you use a right-indent tab instead of a regualr right aligned tab [tricky to do a leader, but that's another discussion] substitute ^y for the ^t), then add a nested Line Style for one line. That line style should use a second character style that is based on the first character style you created for the name text and has no other attributes if you want the line to be the same from end to end. Sounds more complex than it is, and will work for listings with variable lenghths. The trick is to repalce your paragraph returns with forced line breaks, and will require a little thinking.
    If using separate paragraph styles for each line, you'd use the same technique of a nested style up to a tab for the first line, but there is no need to get fancier since it will apply to the whole line if there is no tab. The paragraph style, in this case, would carry all of the bold and size formatting (and no need for any indents), and the character style would be nothing more than a name that will allow you to use it in the variable.

  • Question for scripting gurus: GREP search, change case make Smallcaps

    I have no knowledge of scripting at all, but this question keeps coming up during training sessions: is it possible to (java)script this:
    - Do a GREP search \u\u+
    - Change case to lowercase
    - Apply SmallCaps (or: apply character style)
    this would allow to search for acronyms and change them to smallcaps (or, even better: apply a character style with small caps and tracking)
    I know it is easy for OpenType smallcaps (do a GREP search, change to OT smallcaps) but this doesn't really change case. And some fonts used aren't OT.
    Anyone?
    Would be VERY apreciated!!

    But Harbs is a seasoned scripter who knows he'll get flamed if one of his scripts "just does not work" ;)
    Well, now that you mention it, the script is not really foolproof. It's a quick and dirty script which I threw together very quickly. It's missing any error checking, some of the variables global, and it's not in a private namespace. These are all things which could cause it to "just not work" ;-)
    Here's a more foolproof construct... (and it'll work on the current story if selected, or the whole document if there's no story selected) It will create a new character style if one does not exist and work on character styles within style groups as well. I wrapped the whole script in an anonymous function to give it a unique namespace as well.
    (function()
    if(app.documents.length==0){return}
    var doc=app.documents[0];
    // Change the following to your style name!
    var character_style_name = 'Small Caps';
    try{var range = app.selection[0].parentStory}
    catch (err){var range = doc}
    //comment out next line if you do not want styles.
    var charStyle = GetCharacterStyle(character_style_name,doc);
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat="\\u\\u+";
    var finds=range.findGrep();
    for (var i=0;i<finds.length;i++){
    finds[i].changecase(ChangecaseMode.lowercase);
    //comment out next line if you do not want styles.
    finds[i].applyCharacterStyle (charStyle)
    //uncomment next line if you do not want styles.
    //finds[i].capitalization=Capitalization.smallCaps;
    function GetCharacterStyle(styleName,doc){
    var charStyles=doc.allCharacterStyles;
    for(var i=0;i<charStyles.length;i++){
      if(charStyles[i].name==styleName){
       return charStyles[i];
    return doc.characterStyles.add({name:styleName,capitalization:Capitalization.smallCaps});

  • How to Change National character set for a database

    Hi All,
    My database is Oracle 10G. Stand alone DB.
    National character set for my DB is "WE8ISO8859P1" and need to change national character set to UTF8.
    Need Help on this.
    Thanks in advance.
    Regards,
    Suresh

    Please go through the topic,
    [http://arjudba.blogspot.com/2009/02/what-is-national-character-set.html|http://arjudba.blogspot.com/2009/02/what-is-national-character-set.html] [http://arjudba.blogspot.com/2009/03/unicode-characterset-in-oracle-database.html|http://arjudba.blogspot.com/2009/03/unicode-characterset-in-oracle-database.html]
    and decide whether you need migration . If you need migration then have a look at,
    [http://arjudba.blogspot.com/2009/03/difference-between-we8mswin1252-and.html|http://arjudba.blogspot.com/2009/03/difference-between-we8mswin1252-and.html]
    [http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and.html|http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and.html]
    [http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and_11.html|http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and_11.html]
    And always check for reports in csscan.
    Edited by: user9533551 on 07-Jul-2009 04:29

  • GREP to find single character

    I put together a GREP style inside of a paragraph style that is supposed to find all instances in the paragraph where there is one single character inside of parethesis. This is what I typed in:
    (?<=\().(?-\))
    and I assigned a character style that is supposed to change the character inside the parenthesis, but not the parenthesis themselves.
    But it's not working. Can anyone help me with how to fix it?

    For any other readers greppling with same,
    (?<=\().(?=\))
    [Breakdown:
    (?<=x) Lookbehind string x
    \(  .. which is an open parenthesis -- escaped, because it's a GREP special character
    .  Any character. Any at all! Imagine that!
    (?=y) Lookahead string y
    \)  .. which is a closing parenthesis -- see above]

  • Using GREP for Address Formatting Varying Addresses

    I create pre-addressed wedding envelopes for my clients. They provide me with a list of their addresses in a word document, and I lay them out in InDesign with each page being one envelope. (So I can export as a pdf and print all 100 or so envelopes in one swipe.)
    The problem is, I'm getting more and more requests for more dynamic addresses. For example, lets say they want something like this:
    Mr. & Mrs. Smith
    1 3 4 5   M A I N   S T R E E T
    NEW YORK, NEW YORK
    87996
    Solution 1: Use Line Styles
    For example:
    Line 1: Style A
    Line 2: S T Y L E  B
    Line 3: STYLE C
    Line 4: Style D
    This would typically work, except sometimes the addresses have 4 lines instead of 3, making some addresses look like this:
    Mr. & Mrs. Smith
    1 3 4 5   M A I N   S T R E E T
    APARTMENT - 7B
    New York, New York
    87996*
    *hint: It thinks this is line 1 again.
    Instead of the desired result:
    Mr. & Mrs. Smith
    1 3 4 5   M A I N   S T R E E T
    A P A R T M E N T  - 7 B
    NEW YORK, NEW YORK
    87996
    Also, it would require replacing every return with a forced line break (attainable, but still.)
    Solution 2: Use Nesting Styles
    This *might* work, but I can't tell it to stop the nesting style with a line break/return, only with specific characters (which I would have to insert line by line and negate the whole point.
    Solution 3: Use GREP
    This is a foreign language from another planet and I CANNOT figure it out. I can set character styles no problem, but telling ID in GREP when to apply them is a mystery to me. HELP!
    BobLevine EugeneTyson @P_Spier << you guys are my heroes!  InDesign

    I don't think that's what he means. The Yahoo push mail uses Yahoo's IMAP which only works if you set up your account on iPhone using the preset Yahoo account setup. This setup does not allow for changing the FROM address, so the email appears to be from the underlying yahoo.com account. If you pay for Yahoo Plus you can use POP and change the FROM address, but then you don't get the benefit of the push email.
    I'd love to hear a solution, but after calling Apple and Yahoo and combing the support boards of both, I don't think its possible at this time.

  • Finished script: Use grep find/change to fill in a supplied table of contents

    This script is now complete, and has been the subject of most of my previous posts. Just in case anyone wanted to know what the finished script ended as, here it is.
    Thanks so much to all. A lot of really helpful folks on this board are very responsible for the success of this task. This script is to be one of hopefully many in the creation of our records. But it's a huge leap forward. Thanks again to everyone that helped.
    Cheers,
    ~Nate
    Task:
    Automatically find town names in listings, and fill in table of contents template on page 2 accordingly.
    Example of page 2 toc, initially:
    Example of a page of content. The town names are what need to be referenced on the TOC:
    Example of page 2 toc once script is finished:
    Because of the need to include the transaction dates on the TOC (comes as a provided, tagged-text file), a simple Indesign-generated TOC can't be used alone.
    This script uses an Indesign-generated TOC that's on a master page called "T-tocGen" ... It then uses grep search and replaces to grab the needed information, and insert it into the page 2 TOC.
    The script will update a generated TOC and then search for an instance of a page number, and town name. The generated toc lists all included towns in the following format:
    (line start)## tab townName(line end)
    In Grep, this would be (please note, extra \ for \d and \t ... javascript needs that for some reason):
    ^\\d+\\t(.*)$
    After the script gets the info it needs from a found instance of the above, it replaces that line with "---", to prevent that line from being picked up once again.
    The script with then place the needed page number in it's rightful place on page 2, replacing the XX.
    A while loop is used to repeat the above process until there are no longer any instances of "^\\d+\\t(.*)$" present.
    Not every town runs every issue, so once the script is done, it removes all remaining instance of "XX" on the page 2 TOC.
    FINAL CODE:
    TOC replace
    This script will use grep find/change methods to apply page numbers in
    tocGen to the XX's on page2TOC.
    // define the text frame of generated TOC
        var tocGenFrame  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
    // udpate generated TOC ... store contents in tocGenStuff
        var tocGenStuff = updateTOCGen();
    // set variable for while loop
    var okGo = "1";
    // while okGo isn't 0
    while(okGo.length!=0)
    // get town info from tocGen
    getCurrentTown();
    // replace XX's with tocGen info
    replaceTown();
    // grep find ... any remaining towns with page numbers in tocGen?
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // set current value of okGo ... with any instances of above grep find in tocGen
    okGo = tocGenFrame.findGrep();   
    // grep find/change all leftover XXs in page2TOC
    app.findGrepPreferences = app.changeGrepPreferences = null;       
    app.findGrepPreferences.findWhat = "^XX\\t";
    app.changeGrepPreferences.changeTo = "\\t";
    app.activeDocument.changeGrep();  
    // clear grep prefs
    app.findGrepPreferences = app.changeGrepPreferences = null;
    //  functions                  //
    function getCurrentTown()
    // grep options   
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // grep find:  startLine anyDigits tab anyCharacters endLine
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.findGrepPreferences.findWhat = "^\\d+\\t(.*)$";
    // get grep find results      
    currentGen = tocGenFrame.findGrep();  
    // store grep results content into currentLine
    currentLine = currentGen[0].contents;
    // match to get array of grep found items
    currentMatch = currentGen[0].contents.match("^\\d+\\t(.*)$");
    // second found item is town name, store as currentTown
    currentTown = currentMatch[1];
    // change current line to --- now that data has been grabbed
    // this is because loop will continue as long as the above grep find yields a result
           app.findGrepPreferences.findWhat = "^\\d+\\t"+currentTown+"$";
                  app.changeGrepPreferences.changeTo = "---";
                tocGenFrame.changeGrep(); 
    function replaceTown()
    app.findChangeGrepOptions.includeLockedLayersForFind = true;
    app.findChangeGrepOptions.includeLockedStoriesForFind = true;
    app.findChangeGrepOptions.includeHiddenLayers = true;
    app.findChangeGrepOptions.includeMasterPages = true;
    app.findChangeGrepOptions.includeFootnotes = true;
    // find: XX currentTown .... replace with: currentLine
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = "^XX\\t"+currentTown+" \\(";
        app.changeGrepPreferences.changeTo = currentLine+" \(";
    app.activeDocument.changeGrep();   
    function updateTOCGen()
    //set vars ... toc text frame, toc master pag
        var tocGen  = document.masterSpreads.item("T-tocGen").pages.item(0).textFrames.item(0);
        var tocGenPage  = document.masterSpreads.item("T-tocGen").pages.item(0);
    //SELECT the text frame generatedTOC on the master TOC
        tocGen.select();
    //Update Table of Contents by script menu action:
        app.scriptMenuActions.itemByID(71442).invoke();
    //Deselect selection of text frame holding your TOC:
        app.select(null);
    //store contents of toc text frame in variable
        var tocGenText = tocGen.contents;
    //return contents of tocGen
        return tocGenText;

    Thanks for the reply.
    You are correct but the problem is there are three rows, One row is 100% black, the second is 60% black and the third is 40% black. I want to change the black to blue, the 60% black to an orange and the 40% black to a light shaded blue. In the find/change option you can select the tint you want to find and replace but yea.. does work on table cells.. oddly enough.

  • Website not displaying correctly. Firefox is changing the character set to Western (ISO-8859-1) automatically.

    Normally I have set Firefox (or it's set by default) to Character Set Unicode (UTF-8) and everything displays perfectly. I've never had a problem before.
    Now however, whenever I upload my own website, for some bizarre reason on that particular tab (and only that tab) the Character Set is changed over to Western (ISO-8859-1) and then there's a few characters within my site that do not display correctly, namely apostrophes and hypens.
    It definitely isn't my software (Serif WebPlus X4) because the page displays correctly in every other browser. Plus it displays correctly in Firefox if I change the Character set back to Unicode.
    PS The site is a work in progress

    That happens because the server sends a content-type (<b>text/html; charset=ISO-8859-1</b>) via the HTTP response headers and in that case that content type prevails. The page code is saved with an UTF-8 byte order mark () that you see in this case.
    *http://web-sniffer.net/?url=http%3A%2F%2Fwww.valuevisionglasses.co.uk&http=1.1&gzip=yes&type=HEAD&uak=0
    *http://httpd.apache.org/docs/current/mod/mod_mime.html#AddType

  • When I load certain websites the the writing is all squashed up. I correct this by changing the character encoding setting. I am using the latest Apple Mac machine. Thanks in advance

    When I load certain websites the the writing is all squashed up. I correct this by changing the character encoding setting. I am using the latest Apple Mac machine. Thanks in advance

    Thanks for that information!
    I'm sure I will be calling AppleCare, but the problem is, they charge for the phone calls don't they? Because I don't have money to be spending to be on the phone with a support service.
    In other things, it seemed like the only time my MacBook was working was when I had Snow Leopard without the 10.6.8 update download that was supposed to be done to prepare for OS X Lion.
    When I look at the information of my HD it says that I have 10.6.8 but that was the install that it claimed to have failed and caused me to restart resulting in all of the repeated problems.
    Also, because my computer is currently down, and I've lost all files how would that effect the use of my iPhone? Because if it doesn't get fixed by the time OS 5 is released, how would I be able to upgrade?!

  • Changing the character set in RoboHelp 7 file converted from 5

    The character set of the output files for WinHelp defaults to
    utf-8. How can the default be set to windows-1252 per project or
    for all projects in RoboHelp 7?

    This is related to the posting - "RoboHelp 7 (with patch) IE6
    does not display popup field definitions". Somewhere in our
    environment the character set is getting changed to western
    european (ISO) for the pages that do not load initially in IE6/XP
    from the OAS even though the code generated by RoboHelp is utf-8.
    The WebHelp generated in RoboHelp v5 has a characterset of
    windows-1252. None of the pages with the character set of
    windows-1252 have a problem loading (or changing the character
    set). The problem may be on the OAS or the single signon
    layer.

  • How to change the character set of the D/b

    Hello All,
    When i issue the command
    ALTER DATABASE CHARACTER SET UTF8
    It gives me the error that I can only change the character set to a superset of the existing character set.
    Is there any way i can change the character set without recreating the database.
    TIA
    Naveen

    The existing character set is the basis for the new character set. This is fair enough, because the character set determines how the actual data is stored in the database. Allowing new characters is a minor change: completely re-encoding your entire database is not.
    I'm afraid export, recreate and import is your only option.
    Cheers, APC

  • How to change the Character Set from AL32UTF8 to WE8DEC

    Hello!!
    I want to know how to change the character set in the database from AL32UTF8 to WE8DEC.
    I tried to use the comand ALTER DATABASE CHARACTER SET but I got an error because WE8DEC is not a superset of AL32UTF8.
    I need to import tables from a server that uses WE8DEC. So when I do the import to my server, wich has AL32UTF8 , I can't import the rows that include an Ñ.
    So I want to change the caracter set to WE8DEC. How can I do it?
    Is it needed to change the language configuration? The remote server has AMERICAN_AMERICA, and my server has MEXICAN SPANISH_MEXICO (both uses text in spanish).
    Thanks a lot!!

    When you export from WE8DEC server what did you use
    for NLS_LANG char set? And when importing?
    The export was done in another computer because I can't do the export in the server (I have 10g, and the remote server has 9i and the export is not working). In my server, when I tried to do the import, the NS_LANG value was MEXICAN SPANISH_MEXICO.WE8MSWIN1252.
    When I try to import to my database I got the error:
    import done in WE8DEC character set and AL16UTF16 NCHAR character set
    import server uses AL32UTF8 character set (possible charset conversion)
    export client uses WE8MSWIN1252 character set (possible charset conversion)
    . importing USRMCR06's objects into PRIMARIZACION
    . . importing table "CHG_FONDOS_MARZO_CD_MOR"
    IMP-00019: row rejected due to ORACLE error 12899
    IMP-00003: ORACLE error 12899 encountered
    ORA-12899: value too large for column "PRIMARIZACION"."CHG_FONDOS_MARZO_CD_MOR".
    "NOMBRE" (actual: 41, maximum: 40)
    Column 1 16623436
    Column 2
    Column 3 Pymes_1
    Column 4

  • Text or GREP find/change method to assign tags

    Hi all
    I could use a text or GREP find/change method to  assign tags to paragraph styles (for use in FindChangeByList), would anyone be able to help please?
    Steve

    Hi Peter
    I produce a quarterly magazine for which text is supplied in Word format.
    I currently run the 'FindChangeByList' script to format body text, headings, bulleted and numbered lists, web and email address text styling and to remove/correct all extraneous characters etc.
    Once the job is printed I need to produce a tagged 'accessible' readable (eg: read out loud function in Acrobat) pdf from the file, for text to speech readers.
    I am currently using the map tags to styles function, which allows me to assign tags which in turn gives me control of the 'text reading' order.
    What I'd like to be able to do is automatically apply the Tags to syles while processing the 'FindChangeByList' script.
    Steve

  • How can I do change File Character when I export application (4.2.1.00.08)

    Hello,
    Please, help me!
    I need to change "File Character" when I export application with Apex 4.2.1.00.08 version, but this option, is not possible. The ComboBox already select with
    "Unicode UTF-8]', but I need "ISO-8859-1 - Europa Ocidental", how can I do change it?
    Thanks

    Please register for a "real" user account rather than the anonymous user7266483.
    You can not change it on the export...this is simply set to whatever is in effect in the DB.
    However, it is totally unnecessary to change it on export. If the database into which you need to import the exported application is "ISO-8859-1 - Europa Ocidental", at the time you begin to import, it will default to "ISO-8859-1 - Europa Ocidental". You need to change this to the character set under which it was exported. In this case, it was "Unicode UTF-8".
    It does not matter that you export and import in the same character set. It only matters that you correctly set the import to match how it was exported.
    -Joe

  • Highlighting the text by changing the "character fill color" with double-spacing?

    Highlighting the text by changing the "character fill color" doesn't seem to go well with double-spacing.
    Has anyone been aware of this issue?
    Try double-spacing the text you highlighted. What's up with this?
    This is so annoying and frustrating. I've been trying to do both of them for like 2-3 hours.
    You CAN do both, of course, but if you double-space the highlighted text, it just creates this huge highlighted part (it highlights the space between the two lines!) below the actual text.
    Anyone help me pleeeeeeeease.

    In Pages v5.2.2, taking Baskerville Regular 12 pt, and double-spacing it with character fill color does produce a nasty effect. With View > Show Rulers, I looked where the lines of text lined up on the vertical scale.
    Then I changed the Spacing selector from Lines to Between. Now, just the text had the character fill color, but the line height had increased visually downward. With the between setting, line height is changed to points, and indicates 27 pt. If you adjust this value to 16 pt, the second line of double-spacing will realign with where it was before the between change, while retaining discrete line character fill color.
    Before: Spacing set to Lines, and 2.0 - Double.
    After: Spacing set to Between, and 16 pt

Maybe you are looking for