Skip to main content
Participant
November 26, 2024
Resuelto

Moving a comma/period from the beginning of the paragraph to the end

  • November 26, 2024
  • 1 respuesta
  • 841 visualizaciones

I have a whole bunch of text where the punctuation got messed up and the commas and periods are at the start of the line/paragraph, instead of the end. I have the same issue with ... but those are rare.

I'm looking for a script or a trick to fix all the text at once.

Este tema ha sido cerrado para respuestas.
Mejor respuesta de brian_p_dts

Your find suggestion does a great job finding the punctuation, but change moves up the punctuation to the previous line, instead of moving it to the end of its current line.

Maybe there is a way to do 3 groups,
1 - the punctuation,
2 - all the text till the end of the paragraph
3 - the paragraph break
and exchange group 3 with 1 

After that we can do you previous suggestion to move it up to the previous line.
Is this doable?


Oh. If you want to move paragraph to end of it's current line, the GREP is:

F: ^(\.+|,)([^\r]+)

C: $2$1

1 respuesta

James Gifford—NitroPress
Legend
November 26, 2024

An example would help, here, if you can share a snip of the text. But I'm having trouble envisioning a situation where a period, a comma or an ellipsis is "at the wrong end" in any consistent fashion that would lend itself to Find/Replace or GREP.

 

You could, for example —

  • Find/Replace all periods with nothing.
  • Find/Replace all paragraph ends (^p) with period-para (.^p)

 

...and so forth. But that assumes a lot of consistency of the formatting all the way through, with (for example) no periods except at the beginning and to be moved to the end of a paragraph.

 

Is it possible to back up and get cleaner copy to start with?

Participant
November 26, 2024

Thank you for the quick reply!

It's song lyrics, which is why some lines finish with a comma, some with a paragraph, and some don't have any punctuation.

Here is an example:
We are one
,since way back in time
.Unified at our start
,We began as a nation to live
.And believe with one heart

Joel Cherney
Community Expert
Community Expert
November 26, 2024

I'd bet money that your text has accidentally had right-to-left text direction applied (it's trying to treat those commas and periods and ellipses as if they were Arabic). I assume that you have plain-vanilla English InDesign installed, and don't have these buttons on your Paragraph panel?

 

 

 

If you do, you can just switch back to left-to-right paragraph direction. But this spontaneous right-to-left setting bug does occasionally happen to users of English-localized ID. If you've used paragraph styles, it's easy to resolve by switching from the World-Ready Composer (which supports RTL scripts like Arabic and Hebrew) to the normal Adobe Paragraph Composer (which does not).