These forums are read-only. Please send questions and feedback by email.

replace option in GREP

Post what you would like to see in future versions

Moderator: vuser

ctammes
Posts: 12
Joined: Thu May 13, 2010 10:16 pm

replace option in GREP

Postby ctammes » Sun Oct 03, 2010 9:54 pm

Would it be possible to add a replace option in the FileSearch (GREP) dialog, so that the results that match the regex in the Search textbox are modified to match the replace regex?

Example: I can use a regex to select records from a CSV datafile. But when I only need one or more specific fields, I have to copy the result to an editor and modify them there. It would be nice if I could skip that step and have only those fields in the Results tab instead of the complete line.

FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Re: replace option in GREP

Postby FileViewer » Mon Oct 04, 2010 9:04 pm

Would it be possible to add a replace option in the FileSearch (GREP) dialog

I made a design decision many years ago that V will not be able to directly modify the contents of files - so I will not be adding any functionality that allows you to replace strings in files.

Is this what you want to do, or do you just want to modify what is displayed in the Results tab so you can then copy it to the clipboard?

If it is the latter, can you give me an example of what you want to do?

Charles.

ctammes
Posts: 12
Joined: Thu May 13, 2010 10:16 pm

Re: replace option in GREP

Postby ctammes » Tue Oct 05, 2010 3:19 am

Charles,

I don't need any editing in existing files, but just modified results.

With Grep and a regex I can select specific records from a file based on a value of a field. When I only need a part of those records, I can select that part by using a subpattern. With a replace option it would be possible to have only the selected subpattern(s) in the Result tab (using $1, $2 or \1, \2).

FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Re: replace option in GREP

Postby FileViewer » Tue Oct 05, 2010 3:47 pm

With a replace option it would be possible to have only the selected subpattern(s) in the Result tab

So you would like the Text column in the Results tab to display your replace string instead of the whole line.

Is that right?

Charles.

ctammes
Posts: 12
Joined: Thu May 13, 2010 10:16 pm

Re: replace option in GREP

Postby ctammes » Wed Oct 06, 2010 11:04 am

Yes, that is the idea. That way I don't have to use an editor to get the results in the format I want.


Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 10 guests