The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
search for a string -perl meghana Shell Programming and Scripting 11 02-12-2008 09:44 PM
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 10:24 AM
Search string in array (perl) man Shell Programming and Scripting 6 07-24-2007 12:14 PM
perl: string comparison as numbers bishweshwar UNIX for Advanced & Expert Users 7 05-27-2007 01:54 AM
Perl: Search for string then parse next line pondlife Shell Programming and Scripting 4 04-06-2006 05:44 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-21-2008
Crypto Crypto is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 5
Perl: Search for string on line then compare numbers!

Hi All,

I have a file that I need to be able to find a pattern match on a line, take the number on that line check if its >0.9 or <0.1 and if this is true write the line to output.out file.

An example of 4 lines in my file is:

1. driver.I177.I11.net010 1.48622200477273e-05
2. driver.I177.I11.net018 0.999979181369536
3. driver.I177.I11.net019 0.699980513717918
4. driver.I177.I11.net23 1.05599228036606e-05
5. vsub 2.42896969967089e-05

The above is an example of four lines. I want to find all the lines containing "driver" (lines 1,2,3 and 3) check if the numbers meet 0.1<x<0.9 and write the lines that match to a output file (line 3).

Hope that makes sense!!
Many thanks
 

Bookmarks

Tags
awk, perl script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 09:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0