Book a Demo

Author Topic: Global Text search and replace in Project browser  (Read 6768 times)

k8

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Global Text search and replace in Project browser
« on: October 22, 2013, 10:52:16 pm »
I have a project that I want to make an almost identical copy of, save a few tweaks here and there. The problem is we use a naming convention whereby the name of every package, diagram and element within a project is prefixed with a 3 digit project code.  My question is, is there a quick way of doing a global rename to change this prefix throughout the project, a global find/replace?  Or do I really have to go through every individual element and re-name it?  There are several hundred instances and I'm getting RSI just thinking about it...! :o any help gratefully received, thanks :)

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Global Text search and replace in Project brow
« Reply #1 on: October 22, 2013, 11:24:58 pm »
Hi,

you can write a little script/addin doing this.

Of course it's also some work. I have written such Addin before a couple of years.

Helmut

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Global Text search and replace in Project brow
« Reply #2 on: October 22, 2013, 11:27:46 pm »
You might also be able to accomplish that with a little SQL (you would need to use some SQL substring/concat functions for that if you have just to replace a prefix).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Global Text search and replace in Project brow
« Reply #3 on: October 23, 2013, 04:41:12 pm »
I'v been working on an add-in that does that too, but I never got around to finishing it.

Probably the easiest, and quickest way is to export the whole model to xmi, and use a text editor to search and replace.

Then import the xmi again.

This will only work if your model isn't too big.

Geert

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Global Text search and replace in Project brow
« Reply #4 on: November 13, 2013, 07:17:12 am »
Hi,

have a look in the Community Resources. I've added an Addin to search & replace in EA.

You can:
  • recursively search & replace from a package
  • globally by an arbitrary EA Search like Simple or your lovely SQL search

You may use simple and easy text replacement or powerful regular expression.

You can search & replace:
  • Element/Package/Diagram name
  • Element/Package/Diagram note
  • Tagged Value
  • Constraint

There are a lot more features. I developed it a few years ago to optimize component design by using a component, copy it and change it according to naming conventions.

Helmut





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

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Global Text search and replace in Project brow
« Reply #5 on: December 16, 2013, 12:14:35 pm »
That would be in the EA 10 wishlist
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.