Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

How to find a character when it appears at the end of a line?

New Here ,
Apr 28, 2022 Apr 28, 2022

I am laying out a document that includes small verse numbers. I want to search for instances when an orphaned verse number appears at the end of a line, so a soft return can be inserted before it. (see attached screenshot)

 

Is there a way to do this in the Find/Replace panel or through GREP?

TOPICS
How to , Type
537
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 28, 2022 Apr 28, 2022

Hi @tdykstra57,

I don't think we can find end of lines using Find/Change panel. A script could help, are you open to using a script? Another question, how do we find this verse number? Are all the numbers in the text to be identified as verse numbers or the one's that are number and have a specific character style applied to it?

-Manan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 28, 2022 Apr 28, 2022

Diese Zahlen in der Suchen/Ersetzen Funktion nach Farbe und Größe ausfindig machen... Das heißt unter Text und dann unten beim Kästchen wo rechts das T und die kleine Lupe ist, darauf klicken: hier kannst du nach allen Stilen suchen. Dann würde ich händisch den Zeilenumbruch einfügen.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 29, 2022 Apr 29, 2022

Check out my Find Text in Location script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2022 Apr 29, 2022

The end of a line is not a location you can find via a GREP search. You can do end of paragraph or beginning of paragraph but not end of line. I'm thinking you could create a No Break character style, then do a GREP search for something like this 

\d+ [\l\u]+ that will find any digits followed by a space and a string of letters and then apply the No Break character style to it. It will include elements not at the end of the line but it shouldn't really affect them adversely.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2022 Apr 29, 2022

Have you considered putting in a non-breaking space just after the verse numbers? Perhaps with a character style also to define the width of the non-breaking space?

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 29, 2022 Apr 29, 2022
LATEST

This is a whole lot better solution than adding a forced line break. Down the road edits could cause short lines whre you don't want them withthe forced breaks, but not with the non-breaking spaces.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines