The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Awk Parsing bombcan Shell Programming and Scripting 2 04-24-2008 11:45 AM
TAHI Test Suite 3.0.13 (IPv6 Conformance Test Tool branch) iBot Software Releases - RSS News 0 04-06-2008 09:20 AM
test and .test in same directory vikashtulsiyan SUN Solaris 14 12-27-2007 11:25 PM
Keithley Introduces Linux-Based RF Parametric Test Systems - Test and Measurement.com iBot UNIX and Linux RSS News 0 07-23-2007 07:30 AM
XML parsing handak9 High Level Programming 1 11-01-2004 05:13 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
Parsing a configuration Test tile

Team I need help parsing a text file that meet the layout below:

high:850:856:214:855:810
med:852:304:310
low:315:240:323:310

I need to read each line and if for example a line start with high in in that same line there is a 850 or any other number then I wan to print it. The same ohld true for any other line.

Thank you
edpdgr
Reply With Quote
Forum Sponsor
  #2  
Old 02-11-2008
Registered User
 

Join Date: Jan 2007
Posts: 25
lp -dprinter_name $(grep "high" file)

or

grep "high" file > file
lp -dprinter_name file


you can try....

Last edited by alamitab; 02-11-2008 at 01:06 PM.
Reply With Quote
  #3  
Old 02-11-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
This will not work
Reply With Quote
  #4  
Old 02-11-2008
Registered User
 

Join Date: Nov 2007
Location: Belgium & France
Posts: 70
Code:
grep ^high filename | grep "[0-9]" | lpr
Reply With Quote
  #5  
Old 02-11-2008
Registered User
 

Join Date: Feb 2008
Posts: 3
Thank you very much this was so simple.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0