Using !?<title>?<init>! value more that once

You want to talk about Far Manager, but don't know where to turn?
Post Reply
apsen
Posts: 24
Joined: Mon 26 Jan, 2009 18:49

Using !?<title>?<init>! value more that once

Post by apsen »

Is it possible to use value entered for !?<title>?<init>! more then one?
Here's an example of what I mean: Let's say I'd like to search multiple files for the same string and output results to the files with names based on the entered string and original file name. So in apply command (Ctrl-G) I'll try to enter something like this:

Code: Select all

grep "!?String to search?!" "!.!" > "!.!.[here I'd like to insert the value entered at the beginning]"
Thanks
User avatar
t-rex
Страшный и ужасный
Posts: 4910
Joined: Tue 15 Mar, 2005 16:17
Location: Tel-Aviv
Has thanked: 1 time
Been thanked: 8 times
Contact:

Re: Using !?<title>?<init>! value more that once

Post by t-rex »

set var=...
... %var%
set var=
User avatar
Centaur
Posts: 1083
Joined: Tue 05 Apr, 2005 20:09
Location: Novosibirsk, Russia
Been thanked: 2 times

Re: Using !?<title>?<init>! value more that once

Post by Centaur »

set var=!?...?!

But your example is a bad idea because it will break as soon as you want to grep for anything slightly more interesting than a literal string. Alternative | and iteration * are invalid in file names, and backslashes that introduce escapes \b\d\n\r\s\t\w\B\D\S\W will be treated as path separators.
apsen
Posts: 24
Joined: Mon 26 Jan, 2009 18:49

Re: Using !?<title>?<init>! value more that once

Post by apsen »

For some reason set var=!?...?! does not work - %var% is used literally, without substitution. Moreover it requires more complex command and basically defeats quick functionality of Ctrl-G. With that much effort it's basically as much work as writing a script...

Who said my example was perfect? :-) But seriously it's not intended as permanent solution - just quick run for a specific search of decimal string.

There were actually several time I wished this feature would be available. I just don't remember specific cases.
Игорь Юдинцев
Posts: 726
Joined: Sun 03 Apr, 2005 22:00
Location: Казань
Been thanked: 2 times

Using !?<title>?<init>! value more that once

Post by Игорь Юдинцев »

apsen wrote:just quick run for a specific search of decimal string.
Just to mention: why not use regular expression search in Far viewer (or RESearch plugin)?
apsen
Posts: 24
Joined: Mon 26 Jan, 2009 18:49

Using !?<title>?<init>! value more that once

Post by apsen »

Игорь Юдинцев wrote:Just to mention: why not use regular expression search in Far viewer (or RESearch plugin)?
I'm not aware it could work like grep. I need output in separate files.
Игорь Юдинцев
Posts: 726
Joined: Sun 03 Apr, 2005 22:00
Location: Казань
Been thanked: 2 times

Re: Using !?<title>?<init>! value more that once

Post by Игорь Юдинцев »

apsen wrote:I'm not aware it could work like grep. I need output in separate files.
ReSearch can output results into either a new editor window or a single file.
Post Reply

Return to “General Discussions”