I got a problem with restrict to lines not matching.
Restrict line not matching [ > ]
Sub filter Search & replace (Perl Pattern) :
Find pattern :
arp who-has (.*) tell (.*)
Replace
$2,$1,
Sample data:
arp who-has 10.20.1.19 tell bigswitch
linuxbox.50071 > domaincontroller.domain
The result is
,10.20.1.19,bigswitch
linuxbox.50071 > domaincontroller.domain
The result that I want is :
bigswitch,10.20.1.19,
linuxbox.50071 > domaincontroller.domain
Somehow $2 (bigswitch) and $1 (10.20.1.19) is being switched....
I couldn't figure out what's wrong.
Thanks
HR
Netmap Analytics
Problem with restrict to lines not matching
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Thanks mate, it's working....Simon Carter wrote:Use a pattern of
arp who-has (.*) tell (.*?)
Otherwise the default non-greedy match stops as soon as it can.
Try turning on prompt on replace in future to help debug these problems.
I did turn on the prompt on replace, but could not figure out what's going wrong (non-greedy match).
Probably I need to learn more.
Regards,
HR
Netmap Analytics