LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 02-25-2013, 01:54 AM   #1
akeka
Member
 
Registered: May 2012
Posts: 32

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

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

Thanks
 
Old 02-25-2013, 02:07 AM   #2
akeka
Member
 
Registered: May 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Solved

I just remove "BEGIN" and everything worked

Thanks
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


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

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