Skip to main content
Participant
November 8, 2017
Question

Time formatting in indesign

  • November 8, 2017
  • 2 replies
  • 1107 views

Hi Everyone, long time visitor first time poster....I found similar answers on what I was looking for, but not knowing GREP well, I was hoping to clarify.

I have a tv listing that has different formats and I am hoping to make them the same

for example

12p.m./11c Angry Angel Freeform to 12:00 p.m. Angry Angel Freeform

7am/6c The Little Drummer Boy Freeform to 7:00 a.m. The  Little Drummer Boy Freeform

I am looking to add :00 to all times that don't have it and remove /11c via find and change. I tried editing similar post results, but to no avail.

Thanks!

Kris

This topic has been closed for replies.

2 replies

uniqued_tol
Inspiring
November 8, 2017

Hi try this; find:^(\d+)([apm.]+)(/)(\d+\l) change:$1:00\x{20}$2

lfcorullon13651490
Legend
November 8, 2017

To both situations:

12p.m./11c Angry Angel Freeform to 12:00 p.m. Angry Angel Freeform

7am/6c The Little Drummer Boy Freeform to 7:00 a.m. The Little Drummer Boy

Freeform

Try this grep code in find: "(/d)(.?)(/s)" and change to this: "$1:00$3"

Without quotes.

Em 8 de nov de 2017 13:52, "kristeng59760057" <forums_noreply@adobe.com>

escreveu:

Adobe Community <https://forums.adobe.com/?et=watches.email.thread>

Time formatting in indesign

criado por kristeng59760057

<https://forums.adobe.com/people/kristeng59760057?et=watches.email.thread>

em InDesign Scripting - Visualize a discussão completa

<https://forums.adobe.com/message/9955201?et=watches.email.thread#9955201>

Participant
November 8, 2017

"(/d)(.?)(/s)" I switched to "(\d)(.?)(\s)"  it worked...thank you, but it changed more entries than I was looking for. (I also have dates like November 5)

Since the time is the first thing on each line, I had thought something like this for two digits

\r\d\d [\l\u].m.

\r$1$2:00 [\l\u].m.

then this for single digits

\r\d [\l\u].m.

\r$1:00 [\l\u].m.

but when I do it, I just get dollar signs in the text. Apparently I am missing something....

lfcorullon13651490
Legend
November 8, 2017

Because $# refers to a group found in the search. Each group is defined by (xxx).

If you want to change just the entries in the beggining of paragraphs, you can use the ^ to refer to this position.

"(/d{1,2})(.?)(/s)" to "^(/d)(.?)(/s)" where:

^ = beggining of paragraph

(\d{1,2}) = first group = any digit one or wto times

(.?) = second group = any other character one time (or until)

(\s) = third group = any space character

So, you'll find any one or two digits at the beggining of paragraph and every other character until the first space.

Hope it works for you.

PS: I'm sorry about the wrong slash (I'm typing from my mobile when I answered).