The UNIX and Linux Forums  

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-25-2008
sumitc sumitc is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 25
How to grep at nth position?

Suppose the data is as follows:

123456789A123456
123456789A123456
123456789C123456
123456789B123456
123456789A123456

I want to grep only those records containing "A" command can be:
grep "^.........A" file_name

But if data string is very long, suppose A occurs at 690th position.
Its doesn't look good giving 690 dots and then "A"....I am sure there must be some alternative.

Please help!

-Sumit