Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Is there a find/replace for label text?

+15 votes
If I have a lot of node labels that say X and want to change them all to Y is there any sort of find/replace for label text?
in Feature Requests by (970 points)
recategorized by
I second this request. Today I felt the need of a find/replace function that works by searching things in the labels' text and replacing them with a text of my choice.

2 Answers

0 votes
Perhaps this has been resolved time ago, but if you want to replace all texts you can just open a notepad, Find and Replace the texts you want and save. You have to be careful to not destroy the structure or the application texts!
by (150 points)
–2 votes
You can select all nodes or edges with the same (or similar) text using "Tools" -> "Select Elements" and with all the elements in question selected, enter the new text in the "Text" field in yEd's properties view in the lower right corner.
by [yWorks] (133k points)
but this will change the entire label right? If each label is unique but has the same phrase in it and I just want to replace that phrase I don't think this will work.
You are right, my suggestion will change the entire label text.
There is currently no way to replace only some text parts.
OK thanks, I moved this thread over to 'feature request'
You can use an external editor and edit the graphml file directly.
You can use the following sed command to replace all parts of label text with your replaces text. In my example below I replaced every occurrence of w with ω. Replace your old_file and new_file names below to your liking. The new file will contain the edited text labels.

sed 's/>\(.*\)w\(.*\)<y:LabelModel>/>\1ω\2<y:LabelModel>/g' old_file.graphml > new_file.graphml
tutorial please
The sed command saved me, thank you!
Good idea ! Also, a more graphical way to do it is to edit the graphml file with a text editor (I like Notepad++ on Windows), and replace to your liking.
Legal Disclosure | Privacy Policy
...