Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Time formatting in indesign

New Here ,
Nov 08, 2017 Nov 08, 2017

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

TOPICS
Scripting
1.1K
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 ,
Nov 08, 2017 Nov 08, 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>

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
New Here ,
Nov 08, 2017 Nov 08, 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....

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 ,
Nov 08, 2017 Nov 08, 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).

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
New Here ,
Nov 08, 2017 Nov 08, 2017

Thank you for writing it out. Super helpful! Trying to get more into this, and that helps me understand.

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
LEGEND ,
Nov 08, 2017 Nov 08, 2017

Find:  (^\d+)([ap])\.?(m)\.?/\d+\l

Replace by:  $1:00 $2.$3.

(^/)

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
LEGEND ,
Nov 08, 2017 Nov 08, 2017
LATEST

… If you write it, surely no reason to not trust you! 

(^/)

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
Participant ,
Nov 08, 2017 Nov 08, 2017

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

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