Sublime Forum

Search & Replace with searchresult

#1

Hi there,

I don’t know if this i possible. I want to search for a text, and the search result I’d like to copy and paste to another place in the same document.

The file looks more or less like this:

Number=1168889 Team="TTTRE - Krohn Barbour" Driver="Krohn" Description="" Manufacturer=""

Now, I’d like to copy the content of Team (which would be “TTTRE - Krohn Barbour”) into Description="". And that for about 1000 files. :laughing:

The content of Team is different in every single file, so I search for it with “Team=.*”. But how can I copy the result of the search and paste it now to description?

Thanks for your help. :smiley:

0 Likes

#2

What about something like:
Find:

Team="(.*)" Driver="(.*)" Description=""
Replace:

Team="$1" Driver="$2" Description="$1"
I just tried it and it works. (Make sure to turn on regex mode.)

0 Likes

#3

The problem is that there is not always the same order of Team, Driver and Description.

0 Likes

#4

I’d use a scripting language, then.

0 Likes