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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-08-2007
senthil_is senthil_is is offline
Registered User
  
 

Join Date: Sep 2007
Location: singapore
Posts: 35
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.
  #2 (permalink)  
Old 11-09-2007
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,078
awk

Hi,

code:
Code:
awk ' ($0 ~ /^620/ || $0 ~ /^705/ ) && (length($0)==94)' a
Closed Thread

Bookmarks

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 07:13 PM.


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