Hongmu Notes

📇 Text line count statistics

Paste multiple lines of text to count the total number of lines, non-blank lines, blank lines and number of valid characters; when each line contains a mobile phone number or entry, the number of lines is the number of entries.

Text line count statistics

Total number of rows0
non-blank line0
blank line0
Valid number of characters0

Statistical rules: The number of statistical lines is divided according to line breaks, and the line break at the end will not count as an extra line; when each line contains a mobile phone number, email address, or entry, the number of lines is the number of entries; blank lines are listed separately, and the number of valid characters does not include line breaks and spaces.

Instructions for use

Paste the content into the input box above line by line, and the four numbers will be updated instantly: the total number of lines is divided by line breaks, and a single line break at the end will not count as an extra line; non-blank lines only count lines with characters after removing the blanks; empty lines are listed separately to facilitate checking the typesetting; the number of effective characters is accumulated after removing the blanks from each line, reflecting the actual content amount. The most common usage is to put each mobile phone number, email address or order number on a separate line. At this time, the number of non-blank lines is the number of entries, which can be directly checked with the number of entries exported from the source system. Statistics are completed locally in the browser and are not uploaded or retained.

✅ How to check the results

  • Three lines of text with a blank line in between, the total number of lines should be 3, non-blank lines 2, blank lines 1
  • Add a newline at the end, the total number of lines should not change
  • The number of non-empty rows should be equal to the number of source data

🔒 Data and privacy

Statistics are completed locally in the browser. Inputs and results are not uploaded or retained, and will be cleared when the page is refreshed.

Row count example

I would like to see a set of ready-made examples first to confirm the statistical caliber.

The example consists of three lines with a blank line in between. According to the caliber of this page, the total number of lines should be 3, non-blank lines 2, and blank lines 1; if you press Enter again at the end, the four numbers should not change, because the single line feed at the end does not count as a new line. Run the example first and then look at your own data to avoid mistaking caliber differences for tool errors.

OperationTotal number of rowsnon-blank lineblank line
Click fill example321
Press Enter at the end of the example321
Delete empty lines220

After completing these three steps, you can judge whether the tool's processing of the number of lines, blank lines and end line breaks meets your expectations; if it is different from the business caliber, you can refer to the rules in the instructions to adjust the statistical method, for example, clean the blank lines first and then count.

The second purpose of the example is to verify the blank line determination: change the middle line to only enter a few spaces, and the number of blank lines should still be 1, indicating that lines containing only spaces are indeed treated as blank lines; if the spaces are deleted and become truly blank lines, the number will also remain unchanged. Only when the two writing methods obtain the same results can it be confirmed that the statistical caliber is consistent with the effective number of entries in most data systems.

All keywords and tutorials 12

❓ FAQ

Example what the result should be?
Total number of lines: 3, 2 non-blank lines, 1 blank line.
Can the example be modified??
Yes, click "Fill in Example" and edit directly in the input box, and the numbers will be updated immediately.
Is there any ready-made example that I can try?
Yes, clicking "Fill in Example" will write three lines of text with one blank line, and you can immediately see the changes in the four numbers.
var str = $(this).val();