End of paragraph

Hi ,
I m facing problem in finding end of paragraph in text file through java like we do to find the end of file Using EOF like wise i want to find out the end of paragraph.
Do u have any solutions for this.

think about what would idenitfy the end of a paragraph
think about how to read the file
rinse and repeat
heres a hint -
if a new paragraph starts another one most likely just ended.

Similar Messages

  • How to get consecutive numbering at the end of paragraphs?

    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]

    Hi, Camilo:
    First of all,  I was not thinking clearly when I blamed ID for a cross-reference bug. It was my error. Cross-references within a document need to be updated by the author, using the Update cross-references button at the bottom of the Hyperlinks & Cross-References panel, when they're moved or their source content changes. I was thinking about the known issues with cross-references that go between ID document files, which update automatically - performance slows, and sometimes they cause crashes.
    Here's the replacement reply for my previous post #1:
    camilo umaña wrote:
    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]
    It's not clear if the right-hand numbers are supposed to replace the left-hand numbers while keeping the same sequence, or if you want to retain the left-hand numbers. You can use cross-references to create right-hand numbers from the paragraphs auto-numbers.
    Insert a cross-reference to the paragraph at the end of the text, with a format that captures its autonumber, and adds any ornamentation, like the square brackets in your example.
    If the rightmost number must be positioned at the right margin of the numbered paragraph, no matter how long or short it is, or if it wraps around to new lines, add a right-aligned tab stop to the paragraph style, positioned at the location where you want the number to appear, and insert a tab character in the paragraph before the cross-reference.
    If the left hand numbers are supposed to go away, you can't change the paragraph style to a non-autonumbered style, because you need the numbers that the cross-references capture. So, you need to create a character style that's very small and uses Paper for the text color, to hide the autonumbers. If the smallest point size (IIRC, it's 2 points) leaves too much space at the left of the autonumber, you might be able to reduce it further by using a small value in the Horizontal Scale property of the Advanced Character Formats in the Character Style dialog box. Your example seems to show that the numbered paragraphs are indented, so the space occupied by the hidden autonumbers may not be a problem.
    If the paragraphs are rearranged in sequence, you'll need to use the Update Cross-References button at the bottom of the Hyperlinks & Cross-References panel to update the affected cross-references.
    I'm still not clear about numbers at the end of the paragraphs in square brackets. Are they supposed to be the same value as the auto-number at the beginning of the paragraph, except that they use a numeric display format instead of an alphabetic format?
    I don't know of any code that can work with a find/replace action that can capture a paragraph's autonumber and display it at a specific location. As you've seen, cross-references need to be inserted manually. You might post a query in the InDesign scripting forum to see if someone has figured this out. If there's no complete solution, you might want to ask about a script that searches for the ends of paragraphs of the autonumbered paragraph style and opens the Insert Cross-Reference dialog box.
    Using Quick Apply to execute the Insert Cross-References command, which opens the New Cross-References dialog box, might save some energy for doing the many manual cross-references insertions. Search Google for terms like "InDesign quick apply" without quotes. You can open Quick Apply with a keystroke shortcut - Cmd+Return on Mac. You can type abbreviated commands. I use "rt cr" without quotes for (Inse)rt cr(oss-reference). Opening Quick Apply repeats the last command that was entered.
    Also, if you haven't tried a Google search for phrases like "InDesign numbered list at right end of paragraph," without quotes, give it a try. There are lots of links, including one to this forum article. Perhaps there's a golden nugget among them.
    If you think it's important for ID to be able to place autonumbers at the ends of paragraphs, please post a formal feature request here: Wishform Eventually, some user originated feature requests are incorporated in future ID releases.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • GREP reference; need end-of-paragraph expression

    GREP reference; need end-of-paragraph expression
    I'm doing a canned GREP search to delete all trailing zeros. So if I have a number like 8.2500, it changes it to 8.25.
    I have the code to find zeros leading up to a space, line break, and paragraph return but I can't find the expression for an end of paragraph. With hidden characters on, it looks like a hash ( # ).
    Does anyone know what this is?
    If anyone knows a more elegant way to do this, please advise. Here's what I have:
    0+$|00+$|000+$|0000+$|.0000+$|0+\s|00+\s|000+\s|0000+\s|.0000+\s|0+\n|00+\n|000+\n|0000+\n |.0000+\n|0+\r|00+\r|000+\r|0000+\r|.0000+\r

    See my answer in the Script forum: http://www.adobeforums.com/webx/.3bbf275d.59b4d546/0
    (You shouldn't post a question twice.)

  • Search for end-of-paragraph before end of story? CS6

    Hi,
    Does anybody know of a way to search for a paragraph mark directly
    before an end of story marker? I'd like to get rid of them, e.g., in
    footnotes, where the last paragraph mark causes an unnecessary blank line.
    Thanks,
    Ariel

    I found \z on Mike Witherell's great little chart at http://www.jetsetcom.net/useful-resources/indesign-cs6-resources.html
    End of paragraph, at least in GREP is a location, not a character (the metacharacter is $) and can't be selected or replaced. Every paragraph has one. Paragraphs before the end of story also have a paragaph break, and that's what you are trying to remove at the end of your footnote story.
    @David, Why bother withthe lookahead? \z is the location, so I would presume that the search would start at the end of story and look at the last character. That has to be faster than parsing every break in the paragraph to check for the end of story location after, and there's no possibility that you will actually delete the EOS since it can't actually be selected.

  • Insert End of Paragraph mark before any superscript number

    I am formatting a Bible for a client. The text was provided with verse numbers before each verse, but each chapter is one long paragraph. Now the client has decided they want each verse to begin a new paragraph. How can I globally insert an End of Paragraph mark before each superscrpt verse number?

    In case it helps, and for what it's worth, here's what I assumed:
    As in many bibles, the superscript verse number is simply mixed in the text, preceeding the first sentence of the verse. Could be anywhere, and there is no other special treatment involved. Like this:

  • How do I include the End of Paragraph character with the other characters in a GREP definition?

    I have a character style that changes the line spacing.  The GREP definition that applies it is a period.  This selects everything bu t the Endo of Paragrpah character (EOP).  The result is that the entire paragraph reformats but the last line of text has the wrong spacing.
    I am new to GREP and have not yet found a way to include the EOP character in the change.  I have tried  the statement :    .*$   but that has no affect.

    JES5910 wrote:
    Try defining a paragraph style with a smaller font and leading size then the default style and apply it to the pragraph using GREP definition of a period (all characters).
    That's exactly what I did. I started with 12/14 and changed to to a style using 8/9. Everything changed.
    There is no need to select all the text in a paragraph to assign a paragraph style since the style is aparagraph level attribute. You cannot have more than one paragraph style applied to a single paragraph, so it is IMPOSSIBLE that the end of paragraph marker has a different paragraph style applied than the rest of the paragraph. It IS possible, however, to apply a different character style or local formatting to it (and that's one reason it's better to use a triple-click instead of dragging to select an entire paragraph), so if the last line is not picking up the corrct spacing, the EOP character is either character styled or locally formatted.
    The only way you would know if this is the case is by selecting the EOP character, either as part of the entire paragraph, or by itself. If the paragraph style is then listed with a plus sign, there's local formatting applied. If not, check the character styles panel and I think you'll see a character style applied there (it would say mixed if you've selected the entire paragraph, unless of course you've applied the same character style to everything, which would be a major mistake).
    You can use GREP to remove the character style, if that's what it is, by searching for \r and in the change format set the character styel to [None]. This would work for all paragraphs regardless of waht the leading should be. If the incorrect specification is a local format, however, you would have to either select all text and remove local formatting (which might remove somethign you want, as well) or set up GREP searches to look for the \r with the correct paragraph style in the find formatting, then change the leading explicitly for that style inthe change formatting.

  • 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

  • Place glyph at end of paragraph?

    I am putting together a cookbook. I'd like to put a glyph at the end of the last sentence for each recipe. (Basically, the final instruction.)
    Is it possible to create a paragraph format that includes a glyph at the end? Or would I need to rely on GREP to search for the end of the last paragraph for each recipe, then insert the desired character?
    If the answer is GREP, since it has been donkey's ages since I last used GREP regularly (and it wasn't in InDesign), is there a good resource for learning InDesign's GREP?
    Many thanks to this wonderful community! I always get swift, excellent answers.

    For the vast majority of the text, it already exists in FrameMaker 7.2. I am just porting it over to InDesign CS5. Since I am applying paragraph formats, I could, while in each recipe, go ahead and manually enter for the last paragraph for each recipe, but then if I am manually entering something, I might as well manually enter the glyph. I was hoping to avoid manual work as much as possible. :-)
    I will experiment and report back. I may decide not to do the glyph, since I already have several other design elements for each recipe and I don't want the pages to look too busy. The end of one recipe and the start of the next is quite obvious anyway from the formatting of the recipe title paragraph.
    Thank you both so much for your help!

  • InsertHTML causes end of paragraph

    I have a paragraph with style tags such as:
    <body><p style="margin-right=50px">xxxx</p></body>
    If I try to insert a table, or a list or a horizontal rule into the content the end paragraph tag is moved to before the insert such as:
    <body><p style="margin-right=50px"> x</p><table><tr><td>ttt</td></tr></table>xxx</body>
    I have tried the document insertBefore and after routines, the kit insertHTML and HTMLEditorKit insertHTMLTextAction routine. All result in the same problem. I can't even type this into the EditorKit source window and refresh it without it changing. Anyone know how to prevent this?
    Steve
    Steve

    I know table elements are paragraph elements and perhaps that is why it is terminating the previous paragraph. I have not been able to find an answer though and would greatly appreciate one.
    Thanks,
    Steve

  • GREP to Add a Carriage Return at End of Paragraph

    The following search criteria adds a return at the beginning of a paragraph
    Find
    ^.
    Change to:
    ~b$0
    Now I want to instad add a carriage return at the end of the paragraph instead, so I changed my search criteria as shown below, but never get the carriage return. How do I add a carriage return to the end of a pararagh?
    Find
    \z
    Change to:
    ~b

    Peter
    Thanks for your help. I want to create a new, empty paragraph so I can apply a different paragraph style to it than the paragraph style used in the preceding paragraph. Once I have that, I will cut and paste text into the new paragraph that uses the just applied paragraph style.
    Or perhaps more simply, move text that already has a paragraph style applied  to it into a new location, but first have that new location set up with the correct paragraph style so that the formatting is not lost.
    Hope that makes sense.

  • GREP remove white space at start and end of paragraph

    Hi,
    Question for the GREP experts: I'd like to construct a GREP expression
    that will remove all white space at the start AND end of a paragraph in
    one go.
    What I've got so far works, but you have to run it twice to work:
    I'll try and post it at the bottom of this message, but since I'm
    posting via email it probably will come out scrambled, so I'll describe
    what I've got so far:
    Two expressions in parenthesis separated by the OR character (pipe). The
    first expression searches for one or more space, tab or white-space at
    the beginning of a paragraph.
    The second expression searches for the same at the end of the paragraph.
    Each expression is in parenthesis, and the two groups are separated, as
    I say, by an OR sign.
    However, this has to be run twice for it to work. For it removes all the
    spaces at the start of paragraphs, then when run again all the spaces at
    the end.
    Any ideas how to get it to work in one go?
    Thanks,
    Ariel
    The expression is:
    (^[ \ts]+)|([ \ts)+$)

    Arïel, your GREP appears a bit mashed up in the forum -- was it something like this?
    (^[\t\s]+)|([\t\s]+$)
    If so:
    1. "\s" is "any whitespace", so you would not need to include "\t" as well. But I would not recommend this, as a HUGE disadvantage of "\s" is it also includes hard and soft returns: double returns are seen as "any whitespace" (the first return) and then "end of line" (the second return), and the first is removed. ("Disadvantage" is subject to what you want to accomplish, by the way. I usually don't want this so I list each possible whitespace character that may be removed.)
    2. The parentheses around each 'section' of this GREP are not necessary. The OR operator is 'highest level' -- in this case, since you have an entire left part OR an entire right part, you can omit all parentheses.
    3. This works for me ...
    ^[\t ]+|[\t ]+$
    ... and despite Peter's not-too-shabby suggestion, I would still recommend using mine instead. It's easier on ID (since it only has to remove text, not "remove-and-then-insert-again" (which is exactly what using the $.. operators do), and, more importantly, there are limits to what $1 can 'pick up'. I can't recall the special circumstances, but I have had text attributes shift, and footnotes and anchored objects disappear/being mucked up/otherwise mangled.

  • Is it possible to export to PDF without a Return character at the end of every line?

    I am the author of a book whose first edition has been typeset and extensively amended in InDesign.  I now need to rewrite the first edition to produce a second edition.
    When I copy-and-paste from the PDF with which the publisher has supplied me into MS Word, I get a Return character at the end of every line, which means that text doesn’t automatically wrap and sentences are fragmented so that I get spurious grammar errors.
    I know that not all PDF files have a Return at the end of every line.  Is it possible to restrict Returns to the end of paragraphs when exporting from InDesign to PDF?  If so, what should the publisher be asking the typesetter to do?

    Thanks for your lightning-swift and helpful replies, Mike & Ellis.
    I don't have InDesign myself, so I know hardly anything about how it's used.  I'm just trying to research what an internationally-known publisher should already know how to do, but apparently doesn't!
    Following your suggestion, Mike, I have downloaded the trial version of Acrobat and exported the PDF to a Word file.  This has been moderately successful as there are far fewer spurious Return characters, just a few that I suspect may be hangovers from the typesetter having introduced soft returns in ID.
    As you've suggested Peter and Ellis, I'll suggest that the publisher asks the typesettter to export from ID to RTF and Text to see if that's even better.
    Message was edited 15:24 GMT by: AlanS5100

  • How do I correct the line spacing for last line of a paragraph?

    I am using a paragraph style with a GREP  setting all tect to a specific character style (Arial 9 pt with 12 pt leading.)
    The last line had a larger spacing.  Reading the forums I found that the end of paragraph character (EOP) had the wrong font size and checking it I found it was set to 12 pt with auto leading. Somehow  in playing with the text I got the EOP to match the 9/11 setting, but still have the space.
    So I closed the file and changed the default text  to be arial  6 pt so that the paragraph character would no longer dictate the line space.  This has no affect.
    I reset the paragraph as basic paragraph and it sets it to a font Minion Pro @12 pt.  I though t I had changed the default, but nothing changed????.
    I am also a bit confused as to why changing a paragraph style does not change the EOP as well.  Is there a setting to make it behave the same?
    OR
    Is this a problem with the GREP statement?  It currently uses the period character to select everything.

    Have you tried simply placing your cursor in the problematic paragraph and click on "clear overrides"? If it works for one paragraph, select them all and do that.
    However, what is the underlying paragraph style? Have you tried changing the leading in the paragraph style definition.
    It sounds a little like what's happening is that your grep style is applying a charater style to all character but not the EOP marker, which is taking it's leading from the underlying paragraph style.
    Also, why are you using a GREP stye to apply a character style to everything in the paragraph. It would make more sense to define those attributes withing the paragraph style itself.
    Ariel
    www.FreelanceBookDesign.com

  • Find/Change Grep only finds one instance per paragraph, where am I going wrong?

    Hi,
    I've been using a Find/Change Grep to find any price with a comma and change that comma to a thin space (Newspaper's editorial style).
    But the Grep only finds the first instance of this per paragraph.
    Sample text...
    "$200,000 $200,000 $200,000.
    text at start of paragraph $200,000
    $200,000 text at end of paragraph
    tab     $200,000."
    In the sample the grep would miss the second and third price on the first line.
    I've been using...
    Find...
    (?<=\$)(\d{3})\,?(\d{3})
    also tried (\$\d{3})\,?(\d{3})
    Change to...
    $1~<$2
    Is there anything I can add to find these last two prices?
    I've been using this in combination with Batch Find Replace script, so different greps are set up for 5,6 and 7 digit numbers that start with $.
    Thanks.

    Try this,
    Find what: (?<=\x{0024})(\d{3})\,?(\d{3})
    Change to: $1~<$2
    Vandy

  • Find/Change Inserting paragraph break

    Hello
    I am trying to insert a paragraph mark between two lines of text using find/change
    The first line has a heading style and I want to insert an empty line (Paragraph) after it and before the next line (without changing any formatting)
    I am able to use enter the correct parameters in find but can't figure out what parameter to use in 'Change to"
    Forced line break doesn't produce what I want. Neither does standard carriage return (not sure what that is)
    I have tried both Text and Grep dialogs without success. Yes I read the help files.
    This will be simple for you guys but is stumping me.
    Any ideas oh brilliant ones?
    As usual Thanks much in advance

    Err, a paragraph mark? You mean a paragraph break?
    Anyhow, if you insist on Doing it Wrong, you can use ^p ("End of Paragraph") in the change field. So you might
    change ^p to ^p^p to insert a blank paragraph between each paragraph. For instance. But again, it is the wrong answer.
    Yes-a paragraph break.' Sorry for the imperfect terminology
    The first line is a heading style which I was advised in this forum to make into a 'list style' due to TOC issues
    The 'doing it wrong' paragraph is going to be used to anchor a graphic and then converted to a very small paragraph mark (nearly invisible) as advised in another article
    I did use the
    change ^p to ^p^p
    but it creating another list style as the paragraph break. Its ok. I went ahead and did it anyway and then manually changed all of those entries into a regular paragraph 'break'
    With 300 graphics I would like to automate this but.....
    Thanks for your reply

Maybe you are looking for

  • Some applications are "crashing"

    This just started today, but some app's on my iPhone are "crashing". The just quit and return to the home page. App's that have quit include iPod, Google Maps, and Safari. At least it does this gracefully. I will try restarting and see how that works

  • No Signal from appletv.

    I've already  I. Restored AppleTV via iMac 2. rebooted using the remote but still no signal.  Cabling and TV working fine.

  • Reporting Services Failover

    I have few questions about Reporting Services: 1. can reporting server DB put on a cluster? if so is there a reference article which shows how you can target a specific location for Reporting DB and Reporting TempDB 2. for reporting server DR, should

  • Problem While Adopting Task list having components, in  PM Order

    HI ,       I am working in simple scenario in two landscapes I have created a general task list having some component  assigned to one operation. I am creating new PM order & adopting the task same task list using direct entry. The task list is getti

  • CS4 to CS5 Photoshop

    Hi,    I have a legit CS5 P/S upgrade, I installed it but during the install did not even ask for proof that I already had CS4 active, anyway it has installed but now I have both CS4 & CS5 and it did not carry across my other installed software/plugi