Sponsored Content
Full Discussion: AWK greater than?
Top Forums Shell Programming and Scripting AWK greater than? Post 302173834 by fpmurphy on Saturday 8th of March 2008 08:11:53 AM
Old 03-08-2008
Quote:
typical of Unix to need such a long winded script for such a simple task!
Not at all true if you know what you are doing in UNIX.

Here is a one liner which does what you want.
Code:
awk -v x=2 '$4 >= x'  data.txt

Just set x to any value you want via the "-v x=" option.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[awk]: Row begins by random number and field 10 is greater than 10.00%

Hello! I wish to extract the pid where CPU is above 10% last pid: 22621; load averages: 4.71, 5.04, 5.13 15:08:34 221 processes: 212 sleeping, 2 running, 1 stopped, 6 on cpu CPU states: %... (3 Replies)
Discussion started by: Lomic
3 Replies

2. Shell Programming and Scripting

AWK greater than 200

I need to grep out usernames with UID's greater than 200 out of the /etc/passwd file for a server migration. It is the third field however I am not sure to to accomplish this. I tried to search the forums but did not seem to find an answer (might have over looked it). Any help would be... (2 Replies)
Discussion started by: insania
2 Replies

3. Homework & Coursework Questions

Problem with awk,not able print the file that is greater than 3000 bytes.

My Script: #!/bin/sh date=`date +%y%m%d -d"1 day ago"` in_dir=/vis/logfiles/to_solmis cp `grep -il ST~856~ $inbound_dir/*$date*` /vis/sumit/in_ASN/ for i in /vis/sumit/in_ASN/* do mkdir -p /vis/sumit/inboundasns.$date cp `echo $i`... (1 Reply)
Discussion started by: shrima.pratima
1 Replies

4. Shell Programming and Scripting

Need to Grep or awk a logfile for greater than value

Hello all Hoping someone would be kind enough to suggest a solution to a problem i have, and see if maybe i can even do this without a script. Essentially i have a very large log file, and within it each line had a value called TTMT, and it records a variable number in the following way, so... (6 Replies)
Discussion started by: 1905
6 Replies

5. Shell Programming and Scripting

Greping the column with a value greater than 50 with awk

Hi All, I am running a command from a remote server using ssh to different servers. I will get a output like below with 4 columns. I want to grab line which is having a coulmn which grate than or equal to 50. How can I do it with Awk or sed ??. I add a space to first row with sed 's/::/:: /g' to... (4 Replies)
Discussion started by: raghin
4 Replies

6. Shell Programming and Scripting

AWK: Cannot read Number of records greater than 1(NR>1)

Hi all, I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using, grep -c . sample.txtor wc -l < sample.txt or awk 'END {print NR}' sample.txtAll these commands shows the count as 1, which means they are reading only the first header line of the file.... (3 Replies)
Discussion started by: mehar
3 Replies

7. Shell Programming and Scripting

awk to get values greater than

data.txt August 09 17:16 2013 August 09 17:17 2013 August 09 17:19 2013 August 09 17:20 2013 August 09 17:21 2013 August 09 17:22 2013 August 09 17:23 2013 August 09 17:24 2013 to print from a point in this file, to the end of the file, i type: awk '/August 09 17:22/,0' data.txt. ... (1 Reply)
Discussion started by: SkySmart
1 Replies

8. Shell Programming and Scripting

Calculate percentage of columns greater than certain value in a matrix using awk

This matrix represents correlation values. Is it possible to calculate the percentage of columns (a1, a2, a3) that have a value >= |0.5| and report the percentage that has positive correlation >0.5 and negative correlation <-0.5 separately. thanx in advance! input name a1 a2 a3... (5 Replies)
Discussion started by: quincyjones
5 Replies

9. Shell Programming and Scripting

Xargs, awk, match, if greater - as a one-liner

Hi I have multiple files for which I want to use awk for the following: Read each line in each file- if any of the columns match "PVALUE=" followed by the number, then print the line in case the number following "PVALUE=" is greater than 0.05. I did the following: ls *.txt | xargs -I @ -P15... (14 Replies)
Discussion started by: ts89490
14 Replies

10. UNIX for Beginners Questions & Answers

Awk: greater than sign is working upside down

Hi, I noticed a weird behaviour with awk. input: A|B|1-100|blabla_35_40_blabla;blabla_53_60_blabla;blabla_90_110_blabla Objective: For each string separated by ';' in $4, if the first and second numbers are included in the interval in $3, then print "TRUE". Otherwise print "FALSE". In... (3 Replies)
Discussion started by: beca123456
3 Replies
Locale::Po4a::Pod(3)					User Contributed Perl Documentation				      Locale::Po4a::Pod(3)

NAME
Locale::Po4a::Pod - convert POD data from/to PO files SYNOPSIS
use Locale::Po4a::Pod; my $parser = Locale::Po4a::Pod->new (sentence => 0, width => 78); # Read POD from STDIN and write to STDOUT. $parser->parse_from_filehandle; # Read POD from file.pod and write to file.txt. $parser->parse_from_file ('file.pod', 'file.txt'); DESCRIPTION
Locale::Po4a::Pod is a module to help the translation of documentation in the POD format (the preferred language for documenting Perl) into other [human] languages. STATUS OF THIS MODULE
I think that this module is rock stable, and there is only one known bug with /usr/lib/perl5/Tk/MainWindow.pod (and some other pages, see below) which contains: C<" #n"> Lack of luck, in the po4a version, this was split on the space by the wrapping. As result, in the original version, the man page contains " #n" and mine contains "" #n"" which is logic since C<foobar> is rewritten "foobar". Complete list of pages having this problem on my box (from 564 pages; note that it depends on the chosen wrapping column): /usr/lib/perl5/Tk/MainWindow.pod /usr/share/perl/5.8.0/overload.pod /usr/share/perl/5.8.0/pod/perlapi.pod /usr/share/perl/5.8.0/pod/perldelta.pod /usr/share/perl/5.8.0/pod/perlfaq5.pod /usr/share/perl/5.8.0/pod/perlpod.pod /usr/share/perl/5.8.0/pod/perlre.pod /usr/share/perl/5.8.0/pod/perlretut.pod INTERNALS
As a derived class from Pod::Parser, Locale::Po4a::Pod supports the same methods and interfaces. See Pod::Parser for all the details; briefly, one creates a new parser with "Locale::Po4a::Pod->new()" and then calls either parse_from_filehandle() or parse_from_file(). new() can take options, in the form of key/value pairs, that control the behavior of the parser. The recognized options common to all Pod::Parser children are: alt If set to a true value, selects an alternate output format that, among other things, uses a different heading style and marks =item entries with a colon in the left margin. Defaults to false. code If set to a true value, the non-POD parts of the input file will be included in the output. Useful for viewing code documented with POD blocks with the POD rendered and the code left intact. indent The number of spaces to indent regular text, and the default indentation for =over blocks. Defaults to 4. loose If set to a true value, a blank line is printed after a =head1 heading. If set to false (the default), no blank line is printed after =head1, although one is still printed after =head2. This is the default because it's the expected formatting for manual pages; if you're formatting arbitrary text documents, setting this to true may result in more pleasing output. quotes Sets the quote marks used to surround C<> text. If the value is a single character, it is used as both the left and right quote; if it is two characters, the first character is used as the left quote and the second as the right quote; and if it is four characters, the first two are used as the left quote and the second two as the right quote. This may also be set to the special value none, in which case no quote marks are added around C<> text. sentence If set to a true value, Locale::Po4a::Pod will assume that each sentence ends in two spaces, and will try to preserve that spacing. If set to false, all consecutive whitespace in non-verbatim paragraphs is compressed into a single space. Defaults to true. width The column at which to wrap text on the right-hand side. Defaults to 76. SEE ALSO
Pod::Parser, Locale::Po4a::Man(3pm), Locale::Po4a::TransTractor(3pm), po4a(7) AUTHORS
Denis Barbier <barbier@linuxfr.org> Martin Quinson (mquinson#debian.org) COPYRIGHT AND LICENSE
Copyright 2002 by SPI, inc. This program is free software; you may redistribute it and/or modify it under the terms of GPL (see the COPYING file). perl v5.14.2 2012-05-17 Locale::Po4a::Pod(3)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy