Formatting text with GREP or find/change

Hi,
Is there a quick find/changesearch or a GREP that I can use to format all the text that is inside a pair of pipes? For example "|Gone with the Wind|" would then be italicized.
I have over a hundred pages of text that has been placed inside these pipes, and had Microsoft Word find/replace to format them, but can't seem to figure out how to do it in InDesign.
thanks in advance,
Lina

If the pipes are not to be deleted - in this case GREP is not the best way. Try nested style instead:
Have fun

Similar Messages

  • Text or Grep in Find.change script by list?

    Would like to use the grep formating in this query (instead of text) but the script shows error:
    text {findWhat:" )"} {changeTo:")"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    Why here coexist two ways of writing?
    How to decide?

    @Laurent: heh heh. After that long story I was still paying attention to the original question...
    Mariana:
    ... as this can combine more characters in a search, for example finding space before point, period, semicolon, etc. Or space after ( or before)...
    Yes, that's possible with GREP. Try this for the first one:
    grep {findWhat:" ([.,:;])"} {changeTo:"$1"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Remove space before period et al.
    (Remember the script needs TABS between the sections, as in the original file.)
    This one is a bit challenging. Actually, the period is a special character in GREp (it stands for "any character"), so normally you would need to escape it:
    (space)\.
    to search for a space followed by a period. However, the square brackets [...] define an OR group, and that removes the magic properties from the period. Apparently, there is no use for a wildcard character in an OR group! (That would be something like, "The following characters are allowed: a comma, a colon, any at all, a semi-colon ...")
    There is a more advanced way to remove spaces like these. You want to look for spaces which are followed by any of these characters, and replace them with nothing. That would be
    {findWhat:" (?=[.,:;])"} {changeTo:""}
    You can try this in the interface to see it works.
    The second can be done using the Unicode value for an ellipsis ("\x{2026}" -- another notation than in the regular Text find), or with the special escape code "~e". Yup -- there is another escape character. The backslash is used by GREP itself, but GREP does not understand InDesign's own special characters -- page breaks, smart single and double quotes, Indent-To-Here, em dashes, and a few others. They can also be inserted from the menu on the right side of the Find field. These characters need a tilde, so InDesign can "translate" them internally to something GREP can use, and GREP never sees them. Since the tilde is nothing special for Javascript, you can safely insert only one in the script data file ...
    To remove a space before or after an ellipsis, you could use this:
    grep {findWhat:" ?~e ?"} {changeTo:"~e"}
    ... but in this case it may again be simpler to stick to regular text mode (where you would use "^e" for the ellipsis, by the way).

  • Change formatting dates with GREP

    I am laying out a book with thusands of dates all formatted e.g 02-03-1913. I want to hange these to (eg) 2nd March 1913. I expected it to be a lengthy, staged, operation. But I cannot get GREP to recognise specific numbers (e.g. 02) If worked through logically I did think I could do it in stages. Can anyone help?

    Hi,
    Using Multi-Find/Change, 12 regex, 1 set. So, 1 click and done!
    1/ Search:  (0?)(\d+)-01-(\d{4})
    Replace by: $2~Sjanuary~S$3
    2/ Search:  (0?)(\d+)-02-(\d{4})
    Replace by: $2~Sfebruary~S$3
    12/ Search:  (0?)(\d+)-12-(\d{4})
    Replace by: $2~Sdecember~S$3

  • GREP STYLE, find/change

    Hi!
    My problem is..
    I got these numbers:
    17
    31.9
    32.9
    15
    in a table/cells. They need to have an .00 and 0 like this:
    17.00
    31.90
    32.90
    15.00
    I can use this one for that: find: .$  change: $0.00 but then the numbers with 31.9 gets the .00 also.. 31.9.00
    Any grep styles for that? multiple functions in the same style`?

    A grep style can't change text for you; it can only apply a style to text that matches whatever pattern you set.
    I don't think there any one search/replace that will get you where you want to go, but I was able to do it using two search and replace strings:
    ^\d+(?!\.)\b
    $0.00
    Finds any number of digits at the beginning of a line, that does NOT have a period following it, and returns the same number with ".00" appended.
    ^\d+\.\d\b
    $00
    Finds the remaining instances that have a period and only one digit after it, replaces it with the found text with "0" appended.
    This will not touch anything that has a number that has two digits after the period, like 12.95.
    Give it a try on a copy of your document, see if it does what you need. Depending on how your document is set up, and what other text is in it, you might also want to highlight the table (or just the relevant columns) and restrict the search to the selection rather than the whole document.

  • Formatting text with JSTL (Without bundles!!)

    Hi,
    I am trying to format text aquired from a javabean in my jsp page. The bean has, for example a getName() method.
    The data in the bean was populated from a database and and the name property was set to 'MARTIN'. I want to be able to format this to 'Martin'.
    Now I could probably do this in the ValueObject, or in the DataAccessObject that created the ValueObject, but I don't want to have to change these, as other programs use these as they are.
    I can't seem to find anything in the JSTL that lets me format text, other than from a bundle.
    How can I achieve this?
    Martin

    Thanks for that.
    Just one slight wrinkle. If the property text is upper case, you have to use <str:lowerCase> first, then wrap that in <str:capitalizeAllWords>
    Martin

  • GREP: How can I place a (for example) "*" before and after bold text with GREP?

    Hi there.
    I have a string of text as such:
    I want to use GREP to insert a "*" (asterisk) before and after each bold part. Can I do that with GREP?
    (if asterisk is a problem, I can use a different character)
    Any help would be appreciated.

    Hi Schmaltzkopf,
    try this:
    Have fun

  • Formatting text with Safari

    I am posting ads on a website that doesn't use Safari (or any non PC system, from what I gather) for formatting. As a result, when I paste text in it only allows ktml formatting, which doesn't make paragraphs or do anything else. Is there a way to create text with formatting that will paste in as I format it, or is there a MAC-friendly browser that will allow me to format?

    If this site is really using KTML (as opposed to HTML), then you really don't have many choices for editing anything. Formatting is limited to the site design and capabilities of the system as they designed it.
    You might try this site for a script that works in Safari: http://www.hotscripts.com/Detailed/57712.html
    Mulder

  • Syncing Calendar with Outlook keeps finding changes on BB device in Attendees

    Each time I sync my BB Tour with Outlook, the Sync program finds changes on many of my calendar items with the attendees.  Yet I haven't changed a thing.  In fact, I will sync twice in a row and the 2nd time it finds more changes.  I don't touch a thing in between syncs.  Makes no sense and concerns me that it's going to screw up my Outlook calendar scheduled meetings.  When I look at the details of what has changed, it looks like it's added my contact info as an attendee.  I could see if it did that 1 time for all scheduled meetings but each time I sync, it seems to go find 20 or so meetings, so in the past, som ein the future and tags them as being updated so it needs to update my Outlook.  This sound familar to anyone?  Any idea what's causing it and how to stop it?

    Blackberry Tech Support helped me solve this one.  Was due to me having my Name in my contacts in Outlook but the display name was not the same as my email name in our GAL.  Therefore it kept making changes back and forth to Outlook and then to the device.  Solved the problem by making sure my name / email info in Outlook was the same as in the GAL. 

  • How to auto format text with new Pages?

    I lost my 'auto format' of fractions with the new version of Pages.  Before I would type "1/2" and it would appear as "½".  Where is that feature located in the new version of Pages?

    You can load these manually through System Preferences>Keyboard>Text in conjunction with the relevant characters that can be found using Character Viewer (use the search window in Character Viewer to find "half" etc.)  Cumbersome I know but it is a one time set up.

  • Formatting text with getSelectedText()

    I hope I am in the correct forum for this question.
    I want to format the text contained in a JTextField by double-clicking on the word(s),and then clicking a JButton labelled "Bold".
    I am able to capture the text , using getSelected() but where do I go from here?
    Thanks in advance for any replies.

    You can't change the text attributes for selected text on a JTextField. You can change the Font, but this is used for the entire text field not just the selected text. You need to use a JTextPane for this. Read this section from the Swing tutorial on "General Text Features" for a working example:
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

  • Formatting texts with lines

    I'm having a heck of a time getting a text frame to line up well. I have numerous rows that start with a number. I then have a line after it.
    i.e.
    1.________________________
    2.________________________
    2.a. _____________________
    If I do right align the left is all messed up. If I do left align, the lines don't go to the end and then they don't look good. what can I do? there has to be a way to make it look clean, I see it all the time.

    Combination of:
    Indents
    Tab stops or Right Aligned Tabs
    Underline character style
    Example:
    Paragraph Indent 12 pt
    1st line indent -12 pt
    Right indent 0 pt
    Last line indent 0 pt
    1. (tab) (right align tab with underline) (return or soft return)
    (tab) (right align tab with underline) (return)
    2. (tab) (right align tab with underline) (return)
    etc.
    HTH
    -mt
    Edit: for the sub numbers (2.a. etc), change the indent values to make room for the alpha characters as needed.
    Set them up as nested paragraph styles to make application easy.
    If the rule is not intended to span the width of the text frame, then use Phil's method. Add a tab stop where you want the rule to end, and set a leader (or use the underline character style)

  • Formatting text with a text editor within a website?

    My wife wants to use her new iPad 2 to participate in an online community (Ravelry, a knitting and crocheting site).  She does a great deal of posting to forums within this community.  The text editor for posting in these forums allows users to format their text (bolding, italicize, etc.) as well as to link to other external and internal pages within the site (writers in the forum frequently link to patterns and project images within the site as references in their posts).  When she attempts to use the text editor in Ravelry from her iPad, she is unable to select the text she wants to highlight and alter it (by bolding or making it a link).  When we select the text, the only options are to copy or cut and we can't, once we've selected the text, tap on the "create a link" button  in the text editor.  We've tried to use both Safari and Atomic Web browsers, but no luck.   Help?

    ravelry.com is using WMD-Editor which is a WYWIWYM Markdown editor. Unfortunately it appears their chosen WYWIWYM Markdown editor is no longer or is pretty deprecated.
    You as a user are not going to be able to swap out your own editor for use on any website...these editors are hard coded by the website developer...perhaps you could, as already suggested ask them to update to a more robust editor which supports today's standards. Though I doubt you will get far in having them swap out code for this.
    A Solution:
    Download an alternate browser such as iCabMobile for iOS...I tested ravelry against this browser and the editor does work but is pretty unstable. Funtional but not as intended. Safari cannot load this editor properly at all.
    Log into your ravalry account and read their FAQ (http://www.ravelry.com/wiki/pages/UsingTheTextEditor#formatting_bolditalic_lists _and_other_basics)
    Simple BBCODE commands for formatting where you do not need to even use the tool bar work fine...just a hassle to memorize.
    Hope this helps.

  • Formatting incoming text with style sheets

    Is there a way to "find/change" formatted text with existing style sheets?<br /><br />In other words I have formatted text placed into my indesign document that looks like the following: <bf>Four Patch</bf> Then another set of text that looks like this:<it> Baltimore Press</it> <br /><br />I set up stles sheets formatted for Bold font and Ital font to accomodate these formats. Problem is I have a 500 page book that I need to go through and stylize. I tried to do a find/change global (<bf> </bf> to bold font etc but it didn't work. I was hoping by just putting a space between the <> would  help the find/change option to find all the text but kept saying could find.<br /><br />I hope someone understands what I'm trying to do and can tell me that there is a remedy to the tedious formatting issue I have.<br /><br />Thanks<br /><br />MAria<br />Stuart, Florida

    If you have InDesign CS3, I can think of two ways to deal with this.
    Grep search: set search to
    <bf>([^<]+)</bf>
    and replacement string to
    $1
    and then set the change format to your boldface style. Change all. (I often think it's a good idea to take a copy before doing Change All on a 500-page document, but that's up to you.) Repeat with hopefully obvious changes for the italics. You can save the searches if you need to do this often.
    Adventurous alternative.
    Put the single line
    <stuff>
    at the top of your file, and
    </stuff>
    at the bottom.
    Now it's XML. So open the structure panel, import XML from the fly-out menu. Map Tags to Styles from the same menu, and set up the correspondence you need. Then drag the stuff node from the structure panel to the document.
    If you have to do this more than once, you can import the mapping from an old file each time after the first.
    IMPORTANT: The XML route will fail if you have loose & or less than characters in your file. You would have to replace these with the appropriate character entity references.
    (If you aren't reading this on the forum site, you may be seeing character entity references in the message. Hopefully you can decode them.)

  • Multiple text alignment in one story with GREP (or similar)

    In search of trying to make my workflow much more efficient, I've been dabbling with grep styles and have come across an obstacle. This may be a limit to the character style features but I have been trying to find ways to use multiple text alignments (i.e. left, justified, right) within a single paragraph style sheet applied over multiple paragraphs. Is this actually possible with GREP or similar or do I just have my head in the clouds?
    If this was actually possible in Character Styles, I could quite possible make my job a wee bit too easy!!
    Hope you can assist me with this issue.
    Cheers.

    Alignment is a paragraph level attribute, not a character level attribute, and therefor is assigned in the paragraph style. A paragraph can have only one alignment setting. GREP styles can only assign a character style, so cannot change alignment.
    You could, however, use Find/Change with GREP to find a pattern and assign a pragraph style or new alignment, you just can't automate it the way you do with a GREP style.

  • Find/change using end of paragraph marker /p

    Folks,
    We are attempting to remove a space at the end of a paragraph in unstructured documents.  If I enter ' \p' in the Find text field in the Find/Change dialog FrameMaker finds the the appropriate paragraphs.  If I then enter '\p' in the Change text field in the Find/Change dialog and click Change the space is removed.  However the target paragraphs style is also applied to the the following paragraph.  This occurs in FrameMaker 8,9 & 10.
    If the Find/Change scenario above is followed with these two paragraphs the first paragraphs style is applied to the second paragraph.
    paragraph 1 with a trailing space and using Heading 1 style
    paragraph 2 using Heading 2 style
    Any thoughts?
    regards
    Jon

    JonEBe wrote:
    Arnis,
    Thanks!
    Yes why bother indeed!  I am at the end of a rather lengthy process to convert the creation and output of Framemaker documents into a database with a web front end.  As part of this the existing documents are imported to save lengthy keying/rekeying.  The output from the system is then compared against the originals.  As a matter of course I stripped of leading or trailing spaces (it is amazing how many there are in a manually created/updated document) so we therefore have noisy comparison documents as a result.
    BTW the trailing spaces are apparently a legacy of the conversion from WordPerfect.
    My choices are to re-import without stripping the trailing space and remove them at a later date or create a script using the FDK, which I am very familiar with, and is the likely outcome!
    Jon
    Just a wild thought - a real GREP processor, not the mild imitation in FrameMaker, can find a construction like a space followed by a paragraph marker and delete the space without affecting the marker. The technique is a form of the "lookbehind" or "lookahead" feature. I'm zero-skilled at actually doing this beyond just mentioning it, but the technique might work in a MIF, or text conversion, of the file. Search Google for terms like "GREP lookbehind lookahead," without quotes.
    Another possibility is that once the FrameMaker file is converted to the database, it would be possible to use a database command to remove the space.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

Maybe you are looking for

  • Unable to export SWF, if I've used PSD layers

    I am having trouble exporting an SWF directly from AE6 (It works in CS3 and CS5). Even if I set the render to "rasterize", the SWF will only render up to the point that a Photoshop layer is introduced in the composition. I do not receive any error me

  • No suitable driver found?

    Hey, I've been searching this forum for a problem like mine (and I've found a few that are "like" mine, but none that are exactly the same or that will solve my problem). First, any information that might be relevant (I really have no idea how much o

  • Multiple sites created in iWeb '08 / Personal Domains for Each?

    If I create more than one site in iWeb, can each site have its own Personal Domain? So far, I have created 2 sites: When I publish the first one, it shows up on the web as http://web.mac.com/myname/nameofmysite/etc (which is fine). But I would like f

  • Crop Video Dimensions

    Hi. I am using Premiere Elements 8. I am wanting to crop the actual dimensions of a video I am working on...the video is of someone talking and is quiet narrow. I would like to be able to crop the video so all the extra on the sides is completely gon

  • Regarding Program scan

    hi guys, In R3, we have program RPR_ABAP_SOURCE_SCAN to search objects. Do we have the same report program to access in BW system. Pls suggest me..if any alternative. Regards Baasha