Sponsored Content
Top Forums Shell Programming and Scripting How to grab the value of field before the line reached Post 302179566 by ahjiefreak on Friday 28th of March 2008 04:03:28 AM
Old 03-28-2008
How to grab the value of field before the line reached

Hi.

I have a qury whihc I hope someone could clarify.

I have a file:-

Num Measure
108 0.05
12 0.45
13 0.2
19 0.5

I wanted to grep the value of 19 from Column Num which will then take the minimum value of measure (not including 19's measure value). Means in this case, i am hoping to get 0.05 as the mininum of (0.05,0.45 and 0.2) right before the entry 19. Anyone could advise me on this?


Thanks and appreciate alot.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find 2 line numbers, grab text in between

hi, i have a large text file that I just want to extract the important information from. It will be a random number of lines but between two specific line numbers/markers. I was thinking I could get the line number for the first marker: Tablespace Percent Total Free Then get the line... (11 Replies)
Discussion started by: Da_Duck
11 Replies

2. Shell Programming and Scripting

grab next consecutive line or lines

Hello i'm writting a krn shell that will find the letter F and I would like to grab everything from F till 0:00. Is there a sed or awk command that i could use. Thank you. File is looks like this. 11/12 xxx xxxx xxx F xxxx xxxx some info entered here some info entered here xxxx... (1 Reply)
Discussion started by: wisher115
1 Replies

3. Shell Programming and Scripting

grab the line using awk

suppose u have a file AAAAAKKSKSKMSKMSKBNNSHNKSNJNMSYNMSBH This is exactly wht the input is like Question is i want to list wht is on the line 5 tht will be A but Remember u want to extract in between say from 100 to 300 i tried using awk 'BEGIN {FS=""} {print$100,$300}' file but it will... (1 Reply)
Discussion started by: cdfd123
1 Replies

4. Shell Programming and Scripting

Grab first or second line after a search string

In a shell script, I need to grab the first or second line after a search string in a file. For example: File.out: Random Info Manufacturer: XYZPDQ System Info Manufacturer: Hewlett-Packard Product Name: ProLiant I search for the word FILE, I want to be able to grab the line... (1 Reply)
Discussion started by: jwk1230
1 Replies

5. Shell Programming and Scripting

Compare Field in Current Line with Field in Previous

Hi Guys I have the following file Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above: Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Discussion started by: moutaye
9 Replies

6. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

7. Shell Programming and Scripting

grep grab 19 letters from now or a full line

Hi, I have a file like this >hg19_chr1_123_456_+ asndbansbdahsjdbfsjhfghjdsghjdghjdjhdghjjdkhfsdkjfhdsjkdkjghkjdhgfjkhjfkf hasjgdhjsgfhjdsgfdsgfjhdgjhdjhdhjdfhjdfjgfdfbdghjbfjksdhfjsfdghjgdhjgfdjhgd jhgdfj >hg19_chr1_123_456_-... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

8. Shell Programming and Scripting

Grab line regardless of if it ends with tabs or spaces

so i have a data file that has various lines which may or may not end with spaces or tabs. data.file: , \t \t {sample} <spaces> <spaaces> several more spaces.... {"resemble"}, <nospaces> Command i'm using: sed -n 8p data.file | egrep "\],$|\],\ $" or egrep "\],$|\],\ $"... (1 Reply)
Discussion started by: SkySmart
1 Replies

9. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

10. Shell Programming and Scripting

Grab text after pattern on the same line

data: 8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5i PACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+ 8nwR15UzfeZafaf2bGr8akx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjp lVpOoMLXJ ... (19 Replies)
Discussion started by: SkySmart
19 Replies
MouseX::NativeTraits::Num(3pm)				User Contributed Perl Documentation			    MouseX::NativeTraits::Num(3pm)

NAME
MouseX::NativeTraits::Num - Helper trait for Num attributes SYNOPSIS
package Real; use Mouse; has 'integer' => ( traits => ['Number'], is => 'ro', isa => 'Num', default => 5, handles => { set => 'set', add => 'add', sub => 'sub', mul => 'mul', div => 'div', mod => 'mod', abs => 'abs', }, ); my $real = Real->new(); $real->add(5); # same as $real->integer($real->integer + 5); $real->sub(2); # same as $real->integer($real->integer - 2); DESCRIPTION
This provides a simple numeric attribute, which supports most of the basic math operations. PROVIDED METHODS
It is important to note that all those methods do in place modification of the value stored in the attribute. These methods are implemented within this package. set($value) Alternate way to set the value. add($value) Adds the current value of the attribute to $value. sub($value) Subtracts $value from the current value of the attribute. mul($value) Multiplies the current value of the attribute by $value. div($value) Divides the current value of the attribute by $value. mod($value) Returns the current value of the attribute modulo $value. abs Sets the current value of the attribute to its absolute value. METHODS
meta method_provider_class helper_type SEE ALSO
MouseX::NativeTraits perl v5.14.2 2011-12-04 MouseX::NativeTraits::Num(3pm)
All times are GMT -4. The time now is 08:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy