Author Topic: Find and Replace  (Read 880 times)

Polymorph

  • EA User
  • **
  • Posts: 120
  • Karma: +4/-0
    • View Profile
Find and Replace
« on: December 23, 2016, 12:03:03 am »
Is there any way to perform a find and replace for a text string within the "Notes" of an element?

Any of you scripting gurus got any suggestions if not?

Thanks!

qwerty

  • EA Guru
  • *****
  • Posts: 8967
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Find and Replace
« Reply #1 on: December 23, 2016, 12:15:28 am »
There are at least two ways (but none out of the box AFAIK). You can issue a simple SQL like
Code: [Select]
UPDATE t_<whatever> SET Notes=<newstring> WHERE <whatever>ID = <theId> with Repository.Execute. You can also use SQL string operations for a global change (I'm no SQL guru and don't know that by heart). The other way is to go via the API to find the element and change the notes right there.

q.
« Last Edit: December 23, 2016, 12:17:35 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7740
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Find and Replace
« Reply #2 on: December 23, 2016, 04:31:51 am »
There's also a free tool from Helmut Ortman out there that does find and replace.
Haven't tried it myself though.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 8967
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Find and Replace
« Reply #3 on: December 23, 2016, 04:52:08 am »

Helmut Ortmann

  • EA User
  • **
  • Posts: 884
  • Karma: +37/-1
    • View Profile
Re: Find and Replace
« Reply #4 on: December 23, 2016, 05:18:23 pm »
Hi,

an easy way is to:
- Export Package or Model as *.xml
- Using a text editor for search and replace (be careful not to change unwanted things)
- Import from *.xml

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)