Want to Insert Text at Beginning of a Paragraph Using GREP

I'd like to find the beginning of a paragraph and insert a text (that uses a specific character style) into that paragraph. Below is how I've set up the find/change:
It almost works. The phrase "SECOND ITEM IS FREE!" is inserted at the beginning of the paragraph, which is what I want. But the first letter of the word that was originally at the beginning of the paragraph picks up the character style used on the inserted text. How do I insert the text without changing the character style of the existing text?
Thanks in advance for any ideas on this

[Jongware] wrote:
(Short) Can't be done.
(Long) Well, it can, but not in a single replace. You'd have to first insert the text, then assign the correct character style.
(Slightly longer) You are physically re-inserting that final character, and so it will get that character style assigned. The usual way of finding-but-not-marking is to use a positive lookahead; but that doesn't work, because you would end up with two locations (the caret and the lookahead), and InDesign's particular implementation of GREP does not allow that. (Or rather -- irritatingly -- sometimes it seems to work if you press the Find button, but then a Change All is not going to work.)
So that's why you have to insert at least one character in the Find What, and re-insert it in the Replace With fields.
If all instances of the specific paragraph style need the prefixed text in a specific character style, consider redefining the paragraph style's autonumbering to include text and character style. Redefine the style, and all instances in the current document are changed. All future uses of the style automatically use the prefixed text and style. To update existing instances of the style in other documents with the new definition, use load paragraph styles; to apply the new definition to to other documents in an InDesign book, synchronize the styles. Search Google for terms like "InDesign paragraph styles numbered lists," "InDesign load styles," and "InDesign synchronize styles in book," without quotes for details.
HTH
Regards,
Peter
Peter Gold
KnowHow ProServices

Similar Messages

  • How to insert a character and paragraph break at the beginning of a paragraph using Grep

    Dear Community!
    I am stucked...
    I have several books in indesign, which I want to export into epub. I have a standardized procedure, to be able to assign the task to students.
    My problem i I have a paragraph style 'heading2' and I would like to insert a paragraph break before which is styled 'new page'.
    Here is the theory I have thought about:
    -with find and change find the style 'heading2'
    -insert a special character + paragraph break before the first character of the paragraph
    -with a second find and change find the special character
    -replace with nothing and style with 'new page'
    My question is how to insert with grep (?) before the first character anything.
    Please help me!
    Thanks in advance
    ND

    Look in the flyout panel of your Paragraph panel.
    (Or in the Online Help -- a resource a lot of people seem to overlook... It's even *called* "Keep Options". ...
    >I have a problem along these lines that I have not found the answer to by searching, and neither have I been able to start a new discussion on this. (These forums are kind of hard to figure out)
    ... on the top right of THIS web page I can see a heading "Actions", with below it the text "Start a discussion" ...)

  • How do I insert a bullet in the text where I want it, now at the beginning of a paragraph

    how do I insert a bullet in the text where I want it, not at the beginning of the paragraph?

    Is below what you want to do?  To have a paragraph of text and bulleted items below?
    This is bullet one.
    This is bullet two.
    This is the last bullet!
    You'll need to give some more information in order to help you.

  • How to insert text in existing file.?????

    how to insert text in existing file.?????
    my file contains simple text with numbers of lines having more then 10 MB size and it might be increase up to 100MB.
    i required to seek to spec. position and insert chunk of characters to file without overwriting existing one.
    I tried out with RandomAccessFile class Also.
    Pl. Suggest me way to insert String in existing file.
    Thanks ,
    Timir

    how to insert text in existing file.?????You can't "insert" text into an existing file. You can
    overwrite portions of an existing file or extend one by
    writing past the current end of file.
    If you want to insert text into a file you have to write
    out a new file.

  • Pages Inserting Text in Form

    I am using Pages and want to insert text on a line of a form.  I have not been able to find a way to keep the line from extending as I add the text.  Any suggestions?

    Use inline textboxes for the form fields.
    Peter

  • Freeform to Text: How to insert Text into freeform

    How to edit text into freeform

    Hi FZRR,
    Could you share more information with us? Or you can upload the screenshot to OneDrive and share the picture link here.
    If you want to insert text into freeform shape, there are two methods:
    1. Insert a textbox on the freeform shape, edit text in the textbox.
    2. Select the freeform shape, and right-click > Add text.
    If there is anything I can do for you regarding this issue, feel free to post back.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Am new at pages and cannot figure out how to insert a bullet where I want it in the text, not at the beginning of the paragraph.  Word was much easier for me

    Am new at this forum and also at pages and can't figure out how to insert a bullet where I want it in the text, not at the beginning of the paragraph.  I found word much easier to use.  Please help. Trying to do a resume.

    On a US keyboard it is Option + 8 (above the letters). •

  • Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    You will need to find a forum for MS Word since that is the software that you are trying to manipulate in this.  If you think the processing/creation of the PDF plays a role then you should ask in the forum for the software that you are using to create the PDF.
    This forum is for issue regarding downloading and installing Adobe trial products, so in any circumstance, your issue does not fit in this forum.

  • Script to find a specific section in file & insert text below - how?

    I am dealing with kind of a problem here - I am using pekwm as my window manager and I use menumaker to automatically update the menu on every startup. My problem is that the original pekwm, the first two sections called 'terminal' and 'Run' and the last two sections called 'Go To' and 'pekwm' are overwritten/modified by mmaker so that there's only the applications submenues and  'pekwm' with the 'Themes' section erased and I want to somehow preserve all that. I was thinking of creating a bash script that does the mmaker thing and then use 'sed' or 'echo' to insert the code back into the appropiate areas of ~/.pekwm/menu.
    All I really need to know is how to find a particular string of code in the menu file and insert a block of text below that line using sed or echo.
    Any ideas?
    Last edited by lostinpurdy (2010-07-10 02:32:38)

    Looks interesting. But I'd like to keep it as simple as possible and avoid the part with the extra textfiles and just insert the code text straight into the menu file, kind of like this:
    mmaker --no-desktop -vf pekwm
    sed {
            find-and-goto-line-below-'root menu'-declaration, insert-text {
                                                                                                           entry for 'terminal'
                                                                                                           entry for 'run"
           ~/.pekwm/menu
    sed {
             find-line-below-'pekwm'-submenu-declaration, insert-text {
                                                                                                       entry for 'themes'
           ~/.pekwm/menu
    Obviously it's not real code but it's just to outline how I'd like to have it. Just need to know the correct syntax to make it work. I don't care much for 'Go To' and the rest.
    Last edited by lostinpurdy (2010-07-10 03:48:10)

  • HT4168 epub: I'd like to create chapters for the TOC but don't want the new chapter to begin on a new page. I'd like it to begin on the same page as the prior chapter. How can I do that?

    How can I do this? I currently have my TOC chapters listed as Apples, Oranges, and so on.  But my text chapters begin something like this:
    1
    Apples
    2
    Oranges
    I have "Apples" with header 1, "Oranges" with header 1, etc., so that very nicely in the TOC it is listing my topics as the chapters. However, within the body of the document, 1 appears on one page and "Apples" begins at the top of a new page, separated from "1"; 2 appears one one page and "Oranges" appears at the top of the next page (separated from the "2), and so on.
    Because of the way the book is structured, I need to have the chapter numbers on a top line and the chapter topic beneath it. (The book is further subdivided, such as 1.3a, 1.3b, etc.)
    What I would like is for the TOC to indicate my chapters as Apples, Oranges, etc., but for the chapter text to begin as indicated above.
    How can I do this?  Thanks.

    Peter, I styled the wording of the chapter title (e.g. apples) with my heading1 styling and my sub-chapter titles were heading2. The text is a different font, different color, different size, different everything.  It seems that the epub program has an automatic format to start a new page with each new header. That's what I'm trying to work around. (Originally I styled both the numeral and the chapter title as "heading 1" and it gave each a different page!)
    I am in the process of removing all headers and styling everything manually (which is how it was originally) just to avoid this problem.
    I'm having my e-book done through a publisher (this will be self-published), so I'll be giving them a .docx and they'll convert it to .html (filtered) then .epub. so I need something that creates my Table of Contents as I'd like it, without messing up the text of the book.
    I can give them a list of what I want in the Table of Contents, and have them manually do it, but the TOC may or may not come out how I want it to come out. My preference is to have something automatic. I wanted the sub-units (heading 2) in the TOC but that will never work since I have over 200 of them and it's too much for them to do manually.  It's a very slow process.

  • Adobe photoshop cc crashes/ work area goes black when i try to insert text to a document ?

    when i have eddited a photo and want to insert my watermark when i press the text tool the document goes black this also happens when i create new document and try to make a watermark but when i select another tool the photo re appears can any one help me already been on phone to adobe support they told me to reset all preferences but its stilkl hasnt worked
    thanks scott !

    Windows 8?
    Upgrade the video card driver from the GPU maker's website (NOT Microsoft or a system builder).

  • Want to insert a XSL file's data into a column of type SYS.XMLTYPE??

    Hello Friends
    I want to insert a XSL file's data into a column of a table of type SYS.XMLTYPE. Following is the XSL which i want to add into a table please help in.....
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:fn="http://www.w3.org/2005/xpath-functions">
         <xsl:output method="html" encoding="UTF-8" />
         <xsl:template match="clinical_study">
         <xsl:variable name="status">
              <xsl:apply-templates select='overall_status' />
         </xsl:variable>
    <html>
    <head>
    <title>Summary</title>
    <link href="merckcancer.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
         <div id="trialtop" class="trialtop">
              <div id="trialtophead" class="trialtophead">
                   <H1>Summary</H1>
              </div>
    <!-- start of trial body-->
         <div id="trialmiddle" class="trialmiddle">
                             <span class="trialtitle1"><xsl:apply-templates select='brief_title'/></span>
                   <span class="tealbold">Official Title: </span><xsl:apply-templates select='official_title' />
                   <span class="tealbold" title="ClinicalTrials.gov Identifier">NCT Id: </span><xsl:apply-templates select='//nct_id'/>
    <span class="tealbold">Conditions: </span><xsl:for-each select="//condition[position()!=last()]"><xsl:value-of select="normalize-space(.)" /><xsl:text>, </xsl:text></xsl:for-each>
    <xsl:for-each select="//condition[position()=last()]"><xsl:value-of select="normalize-space(.)" /></xsl:for-each>
    <span class="tealbold">Phase: </span><xsl:apply-templates select='phase' />
    <span class="tealbold">Status: </span><xsl:value-of select="$status" />
    <span class="tealbold">Interventions: </span><xsl:for-each select="//intervention[position()!=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /><xsl:text>, </xsl:text></xsl:for-each><xsl:for-each select="//intervention[position()=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /></xsl:for-each>
    <xsl:apply-templates select='eligibility'><xsl:with-param name="type">short</xsl:with-param></xsl:apply-templates>
    </div><!-- end of middle -->
    </div><!-- end of top-->                         
    <div id="detail" class="detail">
         <div id="detailtophead" class="detailtophead">
              <H1>Details</H1>
         </div>
    <!-- end of detailtop-->
    <!-- start of detail body-->
    <div id="detailmiddle" class="detailmiddle">
    <span class="trialtitle2">Trial Description:</span>
         <span class="trialtitle4"><xsl:apply-templates select='brief_summary/textblock' /></span>
         <span class="trialtitle1">Eligibility: </span>
              <xsl:apply-templates select='eligibility'><xsl:with-param name="type">long</xsl:with-param></xsl:apply-templates>
    </div><!--end of detail middle-->
    </div><!-- end of detail top-->
    <div id="enroll" class="enroll">
    <div id="enrolltophead" class="enrolltophead">
    <H1>Enrollment</H1>
    </div>
    <!-- end of enroll top head-->
    <!-- start of enroll body-->
    <div id="enrollmiddle" class="enrollmiddle">
    <xsl:choose>
                                       <xsl:when test="$status = 'Recruiting'">
         This study has participating centers in a number of locations.
         To take the next step in learning more about participating in this clinical study please call one of these trial contacts.<p/>
         The trial contacts will know this study as <span class="tealbold"><xsl:apply-templates select='//org_study_id'/></span>
         or may know the study under the ClinicalTrials.gov identifier <span class="tealbold"><xsl:apply-templates select='//nct_id'/></span>.<p/>
         <p/>
                                       <xsl:apply-templates select='overall_contact'/>
                                       <xsl:for-each select="location">
                                            <xsl:call-template name='location'/><p/>
                                       </xsl:for-each>
                                       </xsl:when>
                                       <xsl:otherwise>
         This study is not currently Recruiting, it is <xsl:value-of select="$status" />.
                                       </xsl:otherwise>
                                       </xsl:choose>
    </div><!--end of enroll middle-->
    </div><!-- end of enroll -->
    <div id="credit" class="credit">
    <div id="credittophead" class="credittophead">
    <H1>Credits</H1>
    </div>
    <!-- end of credit top head-->
    <!-- start of credit body-->
    <div id="creditmiddle" class="creditmiddle">
                                  Information about this trial has been gathered from ClinicalTrials.gov. Please see
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=http://ClinicalTrials.gov
                                       </xsl:attribute>
                                       ClinicalTrials.gov
                                  </a> for more complete information.<p/>
                                  <xsl:apply-templates select='required_header/download_date'/><p/>
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=<xsl:apply-templates select='required_header/url'/>
                                       </xsl:attribute>
                                       <xsl:apply-templates select='required_header/link_text'/>
                                  </a> <p/>
                                  This trial data was last updated on <xsl:apply-templates select='//lastchanged_date'/><p/>
    </div><!--end of credit body-->
    </div><!--end of credit-->
    </body>
    </html>
    </xsl:template>
    <xsl:template match="brief_title">
              <span class="trialtitle"><xsl:value-of select="normalize-space(.)" /></span>
         </xsl:template>
         <xsl:template match="official_title">
              <span class="tealbold">Official Title: </span>     <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="phase">
              <span class="tealbold">Phase: </span> <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="overall_status">
              <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="eligibility">
              <xsl:param name="type" />
              <xsl:choose>
                   <xsl:when test="$type = 'short'">
                        <span class="tealbold">Eligibility: </span> <xsl:call-template name="ages">
                             <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                             <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                        </xsl:call-template>, <xsl:apply-templates select='gender' />
                   </xsl:when>
                   <xsl:when test="$type = 'long'">
                        <span class="trialtitle">Eligibility: </span>
                             <span class="tealbold">Age: </span> <xsl:call-template name="ages">
                                       <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                                       <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                                  </xsl:call-template>
                             <span class="tealbold">Genders Eligible for Study: </span> <xsl:apply-templates select='gender' />
                             <xsl:text>
                             </xsl:text>
                             <span class="tealbold">Eligibility Criteria: </span>
    <xsl:apply-templates select='criteria/textblock' />
                   </xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="gender">
              <xsl:choose>
                   <xsl:when test=". = 'Both'">Male or Female</xsl:when>
                   <xsl:otherwise>
                        <xsl:value-of select="normalize-space(.)" />
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="overall_contact">
         <span class="trialtitle">Central Contact: </span>
              <xsl:apply-templates select='./first_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./middle_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./last_name' />
              <xsl:apply-templates select='./phone' />
              <xsl:apply-templates select='./email' />
         </xsl:template>
         <xsl:template name="ages">
              <xsl:param name="min" />
              <xsl:param name="max" />
              <xsl:choose>
                   <xsl:when test="($min != '') and ($max != '')">Between <xsl:value-of select="$min" /> and <xsl:value-of select="$max" /></xsl:when>
                   <xsl:when test="($min != '') and ($max = '')"><xsl:value-of select="$min" /> and Above</xsl:when>
                   <xsl:when test="($min = '') and ($max != '')">Under <xsl:value-of select="$max" /></xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="brief_summary/textblock">
              <span class="trialtitle">Trial Description: </span> <xsl:call-template name="substitute">
    <xsl:with-param name="string" select="." />
    </xsl:call-template>
         </xsl:template>
         <xsl:template name="location">
              <span class="trialtitle"><xsl:apply-templates select='.//country' /><xsl:apply-templates select='.//state' /></span>
              <xsl:apply-templates select='./facility/name' /><xsl:apply-templates select='.//city' /><xsl:apply-templates select='.//zip' /><xsl:apply-templates select='.//status' />
              <xsl:apply-templates select='./contact' />
         </xsl:template>
         <xsl:template match="contact">
              <span class="tealbold">Site Contact: </span>
              <xsl:apply-templates select='first_name' />
              <xsl:apply-templates select='middle_name' />
              <xsl:apply-templates select='last_name' />
              <xsl:apply-templates select='phone' />
              <xsl:apply-templates select='email' />
         </xsl:template>
         <xsl:template match="criteria/textblock">
              <xsl:call-template name="substitute">
         <xsl:with-param name="string" select="." />
         </xsl:call-template>     
    </xsl:template>     
         <xsl:template match="facility/name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="country"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="city">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="zip">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="state">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="status">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="first_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="middle_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="last_name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="phone">Phone: <xsl:value-of select="normalize-space(.)" />
    </xsl:template>     
         <xsl:template match="email"><xsl:if test='. != ""'>EMail: <xsl:value-of select="normalize-space(.)" />
    </xsl:if></xsl:template>     
    <xsl:template name="substitute">
    <xsl:param name="string" />
    <xsl:param name="from" select="'&#xA;'" />
    <xsl:param name="to">
    </xsl:param>
    <xsl:choose>
    <xsl:when test="contains($string, $from)">
    <xsl:value-of select="substring-before($string, $from)" />
    <xsl:copy-of select="$to" />
    <xsl:call-template name="substitute">
    <xsl:with-param name="string"
    select="substring-after($string, $from)" />
    <xsl:with-param name="from" select="$from" />
    <xsl:with-param name="to" select="$to" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$string" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Please do as early as possible..
    thanks in advance

    Hi I tried with below querry but iam getting an error message?
    SQL> Insert into temp_clob_tab
    2 SELECT XMLELEMENT("soap:Envelope",
    3 XMLATTRIBUTES ('http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
    4 'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",
    5 'http://schemas.xmlsoap.org/soap/envelope/' as "xmlns:soap"),
    6 XMLELEMENT("soap:Body"),XMLELEMENT("AddListing",
    7 XMLATTRIBUTES ('http://www.christielites.com' as "xmlns" )),
    8 XMLELEMENT ( "SCOMCODE",a.SCOMCODE), XMLELEMENT ( "SLOCCODE",SLOCCODE),
    9 XMLELEMENT ( "DSTART",DSTART),XMLELEMENT ( "DEND",DEND),XMLELEMENT ( "SECODE",SECODE),
    10 XMLELEMENT ( "IAVAIL",IAVAIL),XMLELEMENT ("IOWNED",IOWNED),XMLELEMENT ("SPOSTTRANS",SPOSTTRANS))
    11 from LiteExchangeAvailablity a;
    SELECT XMLELEMENT("soap:Envelope",
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected CLOB got -

  • How to insert text in the text-id using BDC

    Hi Friends,
    I m using the BAPI to upload the data for a transaction .
    In that transaction there are some text id's are created to insert text like 'Container number'.
    I want to insert the text in that text id . But it not a field. Text ids are having object no and table and number .
    Is there any function like 'READ_TEXT' which we use to retrieve the text form text ids to write text in text ids ?
    So that I can use that function to insert the text in the text ids.
    Thanxs.

    Hi Umesh,
    READ_TEXT is used to Read the text , but SAVE_TEXT is used to save the text. but for reading or saving you need correct iD's and text objects.
    Regards
    vijay

  • Inserting text into a Pages document with Applescript

    I want to create a Pages document from a custom template but be able to insert text at various points in the document (inputted data under headings etc). I would like to use Applescript but cannot get insertion points to work, is this possible? As usual, all help gratefully accepted.

    I have made a Pages template that contains tables and I want to enter text into sections of these tables
    That's a completely different story! But that's still possible using GUI Scripting. Here's an example:
    tell application "Pages"
        activate
        select table 1 of body text of front document
        tell application "System Events" to tell process "Pages"
            set theWindow to window 1 whose role description is "standard window"
            click button "Table" of tool bar 1 of theWindow
            keystroke "Cell A1"
            keystroke tab
            keystroke "Cell B1"
            key code 125 -- down arrow
            keystroke "Cell B2"
            -- and so on
        end tell
        select insertion point after table 1 of body text of front document
    end tell

  • Inserting Text into a web page

    I need to know how to insert text into a webpage, like google, search, and then get the result.
    Using the wonders of the internet I have been able to display a webpage, and see the HTML code that is generated, however, I don't know how to insert text into a web page, or get the result.
    Any help, or pointing into the right direction would be appreciated.

    What do you mean by insert into web page? Like
    prefill data on a form?
    Or like a search on google? What are you using to
    do this?
    I am guessing based on the info you gave in your
    question, that you might want to just look at the url
    of the page. For example search on google and you
    will see the text entered into the search field
    inside the url. Learn from that and develop a url
    that will search for the text you want to insert.
    If I am not understanding you, please clarify.Right now, I'm using the URL to search for me, which will work, but the search can be different from website to website, and I would like something closer to an automated form filler if I need to implement something like this again.
    Of course, something like an automated form filler would probably work better, if I were able to retreve the results

Maybe you are looking for