[ale] HELP Scripting gurus

Danny Cox danscox at mindspring.com
Wed Apr 24 09:41:34 EDT 2002


Tomas,

On Wed, 2002-04-24 at 09:27, Mazukna, Thomas wrote:
> need to find out lines in a text file where chars 57-58 = "12"
> awk or sed is capable of doing this ?

	Awk can do it.  Sed would be a bit more of a problem, but could do it. 
Something like:

		sed '^........12' file
		       ^^^ is 56 periods

	Instead, try:

		awk 'substr ($0, 57, 2) == "12"' file

-- 
kernel, n.: A part of an operating system that preserves the
medieval traditions of sorcery and black art.

Danny


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list