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
read space filled file and replace text at specific position COD Shell Programming and Scripting 6 04-21-2008 02:40 AM
check position of end of line(URGENT PLS) evvander Shell Programming and Scripting 6 11-11-2007 02:46 PM
How to print at a specific position of the display efernandes Shell Programming and Scripting 1 01-23-2007 05:08 PM
Print lines with search string at specific position HealthyGuy Shell Programming and Scripting 4 12-04-2006 06:47 AM
How to add character in specific position of a string? victorlung Shell Programming and Scripting 5 09-01-2006 07:33 AM

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

Join Date: Sep 2007
Location: singapore
Posts: 30
check position of end of line for some specific lines

--------------------------------------------------------------------------------

Have to check in a file that the lines starting with 620 and 705
are ending at same posiotin.


82012345
62023232323
70523949558
62023255454
9999

In the above lines, i have to check the lines starting with 620 and 705 are having the length 94.

Can anyone help. Immediate response is very much appriciated.
Reply With Quote
Forum Sponsor
  #2  
Old 11-08-2007
Registered User
 

Join Date: Jun 2007
Location: Beijing China
Posts: 483
awk

Hi,

code:
Code:
awk ' ($0 ~ /^620/ || $0 ~ /^705/ ) && (length($0)==94)' a
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 10:59 PM.


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