Sep 23, 2010 #1 darioit IS-IT--Management Joined Sep 23, 2010 Messages 3 Location IT Hello, how can I find a non-printable ascii character in a txt file with awk utility? Regards Dario
Sep 23, 2010 #2 feherke Programmer Joined Aug 5, 2002 Messages 9,541 Location RO Hi Which AWK implementation ? Code: awk '/[^[:print:]]/{print"found"}' /input/file [gray]# or[/gray] awk '/[[:cntrl:]]/{print"found"}' /input/file Tested with [tt]gawk[/tt], probably will not work with other implementations. If you not have to do other text processing, maybe searching in a hex dump of the file will be easier. Feherke. http://free.rootshell.be/~feherke/ Upvote 0 Downvote
Hi Which AWK implementation ? Code: awk '/[^[:print:]]/{print"found"}' /input/file [gray]# or[/gray] awk '/[[:cntrl:]]/{print"found"}' /input/file Tested with [tt]gawk[/tt], probably will not work with other implementations. If you not have to do other text processing, maybe searching in a hex dump of the file will be easier. Feherke. http://free.rootshell.be/~feherke/