Count characters in file without newlines (tr, wc)
cat myfile.txt | tr -d '\n' | wc -c
Removes newlines from a file and counts the remaining characters using tr and wc -c
cat myfile.txt | tr -d '\n' | wc -c
Removes newlines from a file and counts the remaining characters using tr and wc -c