, sed , wc .
< foo.txt sed 's/[^\t]//g' | wc -c
, sed , . , tr , sed.
< foo.txt tr '\n' ' ' | sed 's/[^\t]//g' | wc -c
Depending on your shell and implementation, sedyou may need to use a literal tab instead \t, however with Bash and GNU sed, this works.
source
share