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

A search & replace question

Engaged ,
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

CC on a Mac.

I have a large document with many "dictionary" definitions, like this:

apple * a common fruit

blue bonnet * the state flower of Texas

bird of paradise * a spectacular tropical bird species

Is there a way I could use search and replace to apply a character style to the beginning of each paragraph, to all the characters to the left of the asterisk?

Views

624

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

Community Expert , Dec 23, 2016 Dec 23, 2016

MarieMeyer wrote:

apple * a common fruit

blue bonnet * the state flower of Texas

bird of paradise * a spectacular tropical bird species

Is there a way I could use search and replace to apply a character style to the beginning of each paragraph, to all the characters to the left of the asterisk?

Answering your question as written—apply a character style to all characters to the left of the asterisk—the nested styles will work fine. If an asterisk (the trigger) isn't there, the character style will ap

...

Votes

Translate

Translate
Guide ,
Dec 22, 2016 Dec 22, 2016

Copy link to clipboard

Copied

Use nested styles in paragraph style instaed of find and replace

Screen Shot 2016-12-23 at 12.05.13 PM.png

I used Your style as character style.. create your own

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
LEGEND ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Hi,

Use a grep style:  ^.+?(?=\*)

(^/)

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
Guide ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

HI Obi.. grep will work but if i added some new text after find and replace done.. it wont change.. so adding in style will be give advantage

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 Expert ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Hi tpk1982​,

Obi-wan Kenobi​ said grep style (in paragraph style) and not Grep (search and replace)

A grep style will work in the same as a nested style.

There are only one thing: The question if repeats (more than one asterisks) exists in the document.

Have fun

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
Guide ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Hi pixxxel schubser

Sorry for the oversight.. yes i aware about grep style

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
LEGEND ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

The problem with a nested style here is that you need to have an *!  😉

(^/)

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 Expert ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Why that is a problem?

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
LEGEND ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

… Hi Bob!

Because, here, on Tatooine, Sith Nested Styles work badly! 

Capture d’écran 2016-12-23 à 13.54.34.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
Guide ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Yes but anyhow he need to apply those character style only (s)he have *

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
LEGEND ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Not a good kind of view!

The para style is applied everywhere and if there's an asterisk, the char style is applied without doing anything else! … or maybe a coffee! 

(^/)

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 Expert ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

MarieMeyer wrote:

apple * a common fruit

blue bonnet * the state flower of Texas

bird of paradise * a spectacular tropical bird species

Is there a way I could use search and replace to apply a character style to the beginning of each paragraph, to all the characters to the left of the asterisk?

Answering your question as written—apply a character style to all characters to the left of the asterisk—the nested styles will work fine. If an asterisk (the trigger) isn't there, the character style will apply to the entire paragraph. As soon as you add it, it will work again.

This works pretty well here on the planet Earth.

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
LEGEND ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

You don't think as Jedis!

You say: If I've an asterisk, I'll take what before and, if not, I'll take all!

A Jedi will simply do as follows: … if not, he goes away! …

(^/) 

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 Expert ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Don't go away, Obi-wan Kenobi —we will use GREP. Who said anything about Nested Styles?

I just remembered that we are back from out of town and I need to return to your puzzle!

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
LEGEND ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

LATEST

I agree! A very useful "correct" answer! A para style to apply … only if you have an asterisk!

So, yes! it's a "correct" answer! The total and definitive justification of style application! …

(^/)

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