Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: Need a new ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 2111 of 2371
Post > Topic >>

Re: Need a new solution for awk problem

by gazelle@[EMAIL PROTECTED] (Kenny McCormack) Dec 22, 2007 at 09:15 PM

In article <slrnfmqmho.988.mar***bill@[EMAIL PROTECTED]
>,
Bill Mar***  <mar***bill@[EMAIL PROTECTED]
> wrote:
>On 2007-12-22, mcbalagtas@[EMAIL PROTECTED]
 <mcbalagtas@[EMAIL PROTECTED]
> wrote:
>>
>>
>> Ok after searching, I figured out I can't use a variable in a pattern
>> search in awk. But it hard for me to give it up since it works so
>> cleanly. The awk statement below gives me the exact output I need.
>> Except for the fact it won't let me change the the pattern for $2.
>>
>You can use a variable as a pattern. Just don't enclose it in / /.
>awk -v var=foo '$2~var'

You forgot to include the fine print.
 




 4 Posts in Topic:
Need a new solution for awk problem
mcbalagtas@[EMAIL PROTECT  2007-12-21 16:15:40 
Re: Need a new solution for awk problem
Janis Papanagnou <Jani  2007-12-22 01:37:51 
Re: Need a new solution for awk problem
Bill Marcum <marcumbil  2007-12-22 13:40:56 
Re: Need a new solution for awk problem
gazelle@[EMAIL PROTECTED]  2007-12-22 21:15:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 12:33:29 CDT 2008.