Home Download Buy Blog Forum Support

Search & Replace with searchresult

Search & Replace with searchresult

Postby xoa on Fri Dec 02, 2011 4:41 pm

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:

Code: Select all
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. :lol:

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. :D
xoa
 
Posts: 2
Joined: Fri Dec 02, 2011 4:30 pm

Re: Search & Replace with searchresult

Postby adzenith on Fri Dec 02, 2011 8:25 pm

What about something like:
Find:
Code: Select all
Team="(.*)"
Driver="(.*)"
Description=""

Replace:
Code: Select all
Team="$1"
Driver="$2"
Description="$1"

I just tried it and it works. (Make sure to turn on regex mode.)
adzenith
 
Posts: 1215
Joined: Mon Oct 19, 2009 9:12 pm

Re: Search & Replace with searchresult

Postby xoa on Fri Dec 02, 2011 9:58 pm

The problem is that there is not always the same order of Team, Driver and Description.
xoa
 
Posts: 2
Joined: Fri Dec 02, 2011 4:30 pm

Re: Search & Replace with searchresult

Postby adzenith on Fri Dec 02, 2011 10:48 pm

I'd use a scripting language, then.
adzenith
 
Posts: 1215
Joined: Mon Oct 19, 2009 9:12 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 23 guests