Difference between revisions of "Count number of characters"
(Created page with "Count number of characters in different approaches == BASH == Step1: Using [https://www.computerhope.com/unix/uwc.htm Linux wc command] <pre> # print the character counts of...") |
(No difference)
|
Revision as of 18:52, 2 October 2019
Count number of characters in different approaches
BASH
Step1: Using Linux wc command
# print the character counts of txt files (include the count of new line) wc -m *.txt # print the newline counts of txt files wc -l *.txt
Step2: Check the Return symbol
- e.g. \r\n costs 2 characters
Step3: number of characters = result of wc -m *.txt - result of wc -m *.txt * 2 - 1 (the last blank line costs 1 character)