[PLUG] Identifying white space in text files

Russell Senior russell at personaltelco.net
Tue Dec 24 15:10:16 UTC 2024


Slightly condensed and with a white space decoder format option
(though space is invisible):

  cat <yourfile> | tr -d '[:graph:]\n\r' | hexdump -ve '1/1 "%_u\n"' |
sort | uniq -c

On Tue, Dec 24, 2024 at 7:02 AM Rich Shepard <rshepard at appl-ecosys.com> wrote:
>
> On Tue, 24 Dec 2024, Russell Senior wrote:
>
> > cat <yourfile> | tr -d '[:graph:]'  | tr -d '\n\r' | hexdump -ve '1/1
> > "%02X " "\n"' | sort | uniq -c
> >
> > This will give you a count of non-printing characters ([:graph:] is
> > "all printable characters, not including space") excluding carriage
> > return and line feed. Space is hex 20, Tab is hex 09.
> >
> > You could wrap that in a script.
>
> Thanks,
>
> Rich


More information about the PLUG mailing list