ok, i've got a question...

Don Bolton lugnut at sequent.UUCP
Wed Sep 26 08:30:45 AEST 1990


In article <9651 at jpl-devvax.JPL.NASA.GOV> lwall at jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
>In article <42900 at sequent.UUCP> calvin at sequent.UUCP (Calvin Goodrich) writes:
>: ...for the unix.gods out there. i have a file that has a whole mess of
>: null characters in it ('bout 1/2 a meg). is there any way (preferably
>: a shell script) to strip them off?
>
>If your tr works like mine, you can just say
>
>	tr '' '' <foo >bar
>
>Other possibilities:
>
>	sed '' <foo >bar
>	perl -pe 's/\0//g' <foo >bar

AWK AWK ACKKKK :-)

awk -f filebelow <oldlist >newlist

{ for (i = 1; i <= NF; i = i + 1)
     { if (i >= NF)
	  printf("%s",$i)
     else
	  printf("%s ", $i) 
     }
printf("\n")
}

course I assume the "null" characters are just blanks here



More information about the Comp.unix.shell mailing list