AWK Question

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Fri Oct 6 00:02:42 AEST 1989


In article <281 at nisca.ircc.ohio-state.edu>, frank at 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 at 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



More information about the Comp.unix.questions mailing list