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

Format from 10.00-11.30 to 10:00-11:30 any GREP help?

Community Beginner ,
Jan 24, 2017 Jan 24, 2017

Copy link to clipboard

Copied

I would like to change the time in a indesign document from 10.00-11.30 to 10:00-11:30.

in the document the time 10.00-11.30 are sometimes with hyphen, others with en dash or even with em dash and with any white space or no space at all.

i think that the correct is 0:00-11:30 with en dash, between the times and without any white space between en dash and numbers.

Views

440

Translate

Translate

Report

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

correct answers 1 Correct answer

Mentor , Jan 25, 2017 Jan 25, 2017

You should deal with the WHOLE pattern, not only with the period before two digits... since that leads to problems, as you see.

Well, it was much too late after midnight yesterday... this one should cover just what needed, in one go:

Find:

(\d\d?)\.(\d\d)[\h~=~_-]+(\d\d?)\.(\d\d)

Change to:

$1:$2~=$3:$4

timing.png

Votes

Translate

Translate
Mentor ,
Jan 24, 2017 Jan 24, 2017

Copy link to clipboard

Copied

This might work:

Find:

(\d\d?)\D[^\r]+(\d\d)\D[^\r]+(\d\d?)\D[^\r]+(\d\d)

Change to:

$1:$2~=$3:$4

Votes

Translate

Translate

Report

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 ,
Jan 24, 2017 Jan 24, 2017

Copy link to clipboard

Copied

In Find/Change, in the Find What field:

(\.)(\d{2})

And in Change to: put

:$2

That will fix the period to colon issue. For the different dashes, you'll have to find out which types of dashes have been used, and create a string of "or not" expressions, which involves the "zero or more times" character of the asterisk.

Votes

Translate

Translate

Report

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 Beginner ,
Jan 24, 2017 Jan 24, 2017

Copy link to clipboard

Copied

thank you Erica!

i just subscribe to your youtube channel.

is there a way to work on a specific pages and not on the entire document?

there are many stories in the document, so search/apply to the document is helpful but i need it to stop at a specific page,

lets say at page 46.. or from page 6 to page 46?

Votes

Translate

Translate

Report

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 ,
Jan 24, 2017 Jan 24, 2017

Copy link to clipboard

Copied

Oh, thanks for subscribing! And I've been trying to get the "space-hyphen/dash-space" thing figured out. The problem I'm running into is the "or not" quantifier...it's grabbing too much. Hopefully someone else can help. Otherwise, if you know it's always "space-hyphen-space" or "thin space-em dash-thin space" you could always use the Text tab instead of GREP and do multiple find/change queries. Still faster than looking at each line of type manually!

You can apply a GREP search to a selection, a story, or the entire document. So if you have one story that runs the length of the pages, you could select text up to the point you need. I often (with something as uncertain as this search) manually click "find next" and visually check each result before I click change/find next. Still quicker than doing anything manually.

Votes

Translate

Translate

Report

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
Mentor ,
Jan 25, 2017 Jan 25, 2017

Copy link to clipboard

Copied

You should deal with the WHOLE pattern, not only with the period before two digits... since that leads to problems, as you see.

Well, it was much too late after midnight yesterday... this one should cover just what needed, in one go:

Find:

(\d\d?)\.(\d\d)[\h~=~_-]+(\d\d?)\.(\d\d)

Change to:

$1:$2~=$3:$4

timing.png

Votes

Translate

Translate

Report

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 Beginner ,
Jan 25, 2017 Jan 25, 2017

Copy link to clipboard

Copied

LATEST

Thank you so much!

you save me for hours of editing this document

or trying to figure out the correct GREP to describe all the hyphen, en dash, em dash etc..

these GREP works for ALL!

THANK YOU!

Votes

Translate

Translate

Report

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