[TriLUG] how to grep
Scott Morris
scmorris at ifndef.com
Thu Feb 6 18:09:41 EST 2003
not sure if position == character number in the line... but:
cat $file | cut -c46-56 | grep 12345678901
might work...
Scott Morris scmorris at ifndef.com
Cleverly Disguised As A Responsible Adult.
pub 1024D/146D0BC9 2000-11-29 scmorris
Key fingerprint = 5348 7697 85AA 2117 8E7C 9A13 26BA C4FF 146D 0BC9
On Thu, 6 Feb 2003, Mike Norwood wrote:
> Hi,
>
> I need to ask a question of this wonderful and knowledgeable group. I
> need to grep a certain number from a file, but only when it is a certain
> location on each line, for example I want to find 12345678901, but only if
> it is in position 46 through 56 on each line in the file, not if it is in
> any other position. What is the simplest way to tell grep to only pull
> out these records and not other matches not in position 46 through 56.
>
> Thanks in advance.
>
> Mike Norwood
>
> Hillsborough, NC
>
> _______________________________________________
> TriLUG mailing list
> http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
> http://www.trilug.org/~lovelace/faq/TriLUG-faq.html
>
More information about the TriLUG
mailing list