Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.unix.questions Subject: Re: AWK Question Summary: Wrong function Message-ID: <827@crdos1.crd.ge.COM> Date: 5 Oct 89 13:58:52 GMT References: <281@nisca.ircc.ohio-state.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 21 In article <281@nisca.ircc.ohio-state.edu>, frank@hpuxa.ircc.ohio-state.edu (Frank G. Fiamingo) writes: | My problem is that I want to check a particular character | position in a record to see whether or not it is a blank. | [ ... ] | BEGIN {FS=""} | {split($0,array); | if (array[28] == " ") {array[28] = 0}; | for(i in array) print array[$1]} | | [ ... ] | Can anyone tell me where I've gone wrong, or a better way | to do this? One liner: substr($0,28,1) == " " { print } -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon