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

Superscript by FindChangBy.JSX

Community Beginner ,
Apr 03, 2024 Apr 03, 2024

Hi all,

I have a file containing 

^{2}  OR _{2}

I want matter in {.....} Superscript. 

I have added below line in FindChangeBy supporting file

Where and how to add Superscript/Subscript.

 

grep {findWhat:"(\\^\\{)(.+?)(\\})"} {changeTo:"$2"} ...

 

Suryakant

TOPICS
How to
487
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
Community Expert ,
Apr 03, 2024 Apr 03, 2024

I would say first check your grep from the find change dialog and when you see it working then use the FindChange file. Now if your requirement is just to find text within {} and replacing if with the text without {} then the following should work

Find 

\{([^{}]+)\}

Change To

$1

If this does not work then please share the text and explain what you wanted and what you are getting

-Manan

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
Community Beginner ,
Apr 03, 2024 Apr 03, 2024

Thanks,

I tried FindChange. It is working fine.

The reason I ask is  IN same file I have make many changes, and keep 1-set ready for future use also.

Suryakant

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
Community Expert ,
Apr 03, 2024 Apr 03, 2024

So you mean that the query I gave worked with FindChange dialog and now you want that to work through the FindChangeByList file?

-Manan

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
Community Beginner ,
Apr 03, 2024 Apr 03, 2024

Sorry. What you gave is selecting everything between  {.....}

But my matter sequence is    ^{2}   OR     _{2}

 

(A) $\mathrm{km} / \mathrm{s}$\\
(C) $\mathrm{km} / \mathrm{s}^{2}$\\
(B) $\mathrm{km} \mathrm{s}$\\
(D) $\mathrm{km} \mathrm{s}^{2}$

 

Your command is selecting {km} also.   My commend is selecting matter correctly.  Only problem is make superscript or subscript. 

 

Suryakant

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
Community Beginner ,
Apr 03, 2024 Apr 03, 2024

Mistakenly Marked as Correct Answer.   How to Undo it??

 

Added to above

Your command is selecting {km} also.   My commend is selecting matter correctly.  Only problem is make superscript or subscript by FindChangeByList. 

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
Community Expert ,
Apr 04, 2024 Apr 04, 2024

Apply a character style with the superscript/subscript set. That should work I think

-Manan

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
Community Beginner ,
Apr 10, 2024 Apr 10, 2024

Yes. I am doing same.

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 ,
Apr 10, 2024 Apr 10, 2024
quote

Yes. I am doing same.


By @suryakant256115023evw

 

Not sure if it is working for you now - but if not - can you post screenshots of BEFORE and AFTER? Examples of what exactly are you trying to achieve.

 

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
Community Expert ,
Apr 10, 2024 Apr 10, 2024
LATEST

Please send us a sample INDD file and the sample txt file with your query and we can test it. A statement saying it does not work with no supporting data isn't too helpfull to identify the problem

-Manan

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