Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2013, 02:54 AM   #1
Registered: May 2012
Posts: 39

Rep: Reputation: Disabled
Problem with awk

Dear guru's

I've text file that I want to show the lines except if the 4th row value are greater than 4500.0

I've tried this awk, but didn't worked

awk 'BEGIN { if ($4 <= "4500.0") print $1,$2, $3, $4, $5}' input file
Is there anything that I missed ?

Old 02-25-2013, 03:07 AM   #2
Registered: May 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled

I just remove "BEGIN" and everything worked



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with awk mahdi.m Programming 7 02-11-2013 02:36 PM
[SOLVED]Wierd AWK behavior / AWK not reading first line. Involar Linux - Newbie 9 11-28-2012 11:53 AM
awk error awk: line 2: missing } near end of file boscop Linux - Networking 2 04-08-2012 11:49 AM
[SOLVED] call awk from bash script behaves differently to awk from CLI = missing newlines titanium_geek Programming 4 05-26-2011 10:06 PM
AWK problem embsupafly Programming 13 08-21-2005 08:43 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration