Sponsored Content
Top Forums Shell Programming and Scripting Xargs, awk, match, if greater - as a one-liner Post 302979182 by RudiC on Wednesday 10th of August 2016 01:36:31 PM
Old 08-10-2016
This is what I get from your above sample file
Code:
awk 'match ($0, /PVALUE=[0-9.]*/) && substr($0, RSTART+7, RLENGTH-7) > 0.05' *.txt
chrX	110000	NRHITS=10;PVALUE=0.6
chrX	120000	NRHITS=18;PVALUE=0.2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK greater than?

Sorry for such a basic question, but I have spent hours trying to work this out! I need an awk command (or similar) that will look at a text file and output to the screen if the 4th column of each line has a value greater than or equal to x. data.txt This is the 1 line This is the 2 line This... (6 Replies)
Discussion started by: dlam
6 Replies

2. Shell Programming and Scripting

awk one liner

input a 100 200 300 b 400 10 output a 100 a 200 a 300 b 400 b 10 Thanx (6 Replies)
Discussion started by: repinementer
6 Replies

3. UNIX for Dummies Questions & Answers

awk one liner

I need a one liner to" find /pattern/ print from x lines before "pattern" to y lines after "pattern" (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

4. UNIX for Dummies Questions & Answers

need an awk one liner

example input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 (3 Replies)
Discussion started by: kenneth.mcbride
3 Replies

5. Shell Programming and Scripting

Awk one-liner?

Hello, I have two files... File #1 1 3 2 5 File #2 3 5 3 1 3 7 9 1 5 2 5 8 3 3 1 I need to extract all lines from File #2 where the first two columns match each line of File #1. So in the example, the output would be: 1 3 7 2 5 8 Is there a quick one-liner that would... (4 Replies)
Discussion started by: palex
4 Replies

6. Shell Programming and Scripting

Search & Replace regex Perl one liner to AWK one liner

Thanks for giving your time and effort to answer questions and helping newbies like me understand awk. I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk. Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies

7. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

8. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

9. Shell Programming and Scripting

awk one liner

The below code is a simple modified sample from a file with millions of lines containing hundreds of extra columns xxx="yyy" ... <app addr="1.2.3.4" rem="1000" type="aaa" srv="server1" usr="user1"/> <app usr="user2" srv="server2" rem="1001" type="aab" addr="1.2.3.5"/>What's the most efficient awk... (2 Replies)
Discussion started by: cabrao
2 Replies

10. Shell Programming and Scripting

sed one Liner inverse range match-help required

cat test.txt a c d e g (2 Replies)
Discussion started by: TomG
2 Replies
PVALUE(1)						      General Commands Manual							 PVALUE(1)

NAME
pvalue - convert RADIANCE picture to/from alternate formats SYNOPSIS
pvalue [ options ] [ file ] pvalue -r [ options ] [ file1 [ file2 file3 ] ] DESCRIPTION
Pvalue converts the pixels of a RADIANCE picture to or from another format. In the default mode, pixels are sent to the standard output, one per line, in the following ascii format: xpos ypos red green blue If no file is given, the standard input is read. The reverse conversion option (-r) may be used with a single input file or when reading from the standard input, but if the second form is used with three separate input files, the three primaries are presumed to be separated in these files. -u Print only unique values in the output, skipping runs of equal pixels. Specifying +u turns this option off, which is the default. -o Print original values, before exposure compensation. If the input file is in XYZE format, the Y (green) channel will correspond to units of candelas/meter^2. Otherwise, the RGB values should be in spectral watts/steradian/meter^2. Specifying +o uses final exposed values, which is the default. -h Do not print header. Specifying +h causes the header to be printed, which is the default. -H Do not print the resolution string. (See also the -r option below.) Specifying an input resolution for reverse conversion also turns this option off. Specifying +H causes the resolution string to be printed, which is the default. -s nbytes Skip the specified number of bytes on the input header. This option is useful for skipping unintelligible headers in foreign file formats. (Does not work when reading from standard input.) -e exposure Adjust the exposure by the amount specified. If the exposure is being given as a conversion factor, use +e instead, so an EXPO- SURE line will not be recorded in the header (if any). -g gamma Set gamma correction for conversion. When converting from a RADIANCE picture to another format, the inverse gamma is applied to correct for monitor response. When converting to a RADIANCE picture (-r option), the gamma is applied directly to recover the linear values. By default, gamma is set to 1.0, meaning no gamma correction is performed. -d Data only, do not print x and y pixel position. -da Same as -d. -di Print ascii integer values from 0 to 255+. If +di is given, the integer values will be preceded by the x and y pixel locations. -db Output binary byte values from 0 to 255. -dw Output binary 16-bit words from 0 to 65535. -dW Output binary 16-bit words from 0 to 65535, byte-swapped. -df Output binary float values. -dF Output byte-swapped binary float values. -dd Output binary double values. -dD Output byte-swapped binary double values. -R Reverse ordering of colors so that the output is blue then green then red. The default ordering (specified with +R) is red then green then blue. -n The RGB values are non-interleaved, meaning that all the red, green and blue data are stored together in separate chunks. Inter- leaving may be turned on with the +n option, which is the default. -b Print brightness values rather than RGB. Specifying +b turns this option off, which is the default. -pP Put out only the primary P, where P is one of upper or lower case 'R', 'G' or 'B' for red, green or blue, respectively. This option may be used to separate the Radiance primaries into three files with three separate runs of pvalue, or only one file when only one primary is needed. Note that there is no space between this option and its argument. -r Perform reverse conversion. Input is in the format given by the other options. The x and y resolution must be specified on the command line, unless the image file contains a Radiance resolution string at the beginning (see -H option above and -y option below). Specifying +r converts from a Radiance picture to other values, which is the default. -p xr yr xg yg xb yb xw yw On reverse conversion, RGB input uses the given set of color primaries. These are written into the output header with the PRI- MARIES variable. -pXYZ On reverse conversion, input is in CIE XYZ coordinates, rather than RGB. The Y channel is assumed to be in candelas/meter^2. -y res Set the output y resolution to res. If +y is specified, then the scanlines are assumed to be in increasing order (ie. bottom to top). The default value for this option is 0, which means that the picture size and scanline order must appear as the first line after the header (if any) in the input file. Either an upper or lower case 'Y' may be used for this option. Since Radiance files always contain such a line, this option has no effect for forward conversions. +x res Set the output x resolution to res. If -x is specified, then the scanlines are assumed to be in decreasing order (ie. right to left). The ordering of the -y and +x options determines whether the scanlines are sorted along x or along y. Most Radiance pic- tures are sorted top to bottom, then left to right. This corresponds to a specification of the form "-y yres +x xres". Either an upper or lower case 'X' may be used for this option. Like the -y option, -x options have no effect for forward conversions. EXAMPLE
To look at the original, unique pixels in picture: pvalue -o -u picture | more To convert from a 512x400 8-bit greyscale image in bottom to top, left to right scanline ordering: pvalue -r -db -b -h +y 400 +x 512 input.im > flipped.hdr pflip -v flipped.hdr > final.hdr AUTHOR
Greg Ward BUGS
The -r option does not work with the -u option. Also, input pixel locations are ignored during a reverse conversion, so this information is not used in determining the scanline ordering or picture size. SEE ALSO
getinfo(1), pcompos(1), pfilt(1), pflip(1), protate(1), ra_xyze(1), rpict(1), rtrace(1), rvu(1) RADIANCE
1/15/99 PVALUE(1)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy