Hongmu Notes

🎯 Keep lines with no more than N characters

Filter by character count line by line, retaining only lines whose length does not exceed N.

Instructions for use

  • Fill in the upper limit of the number of characters (keep it if it does not exceed it) and click "Start Filtering"
  • Lines whose length is exactly equal to the upper limit are retained; empty lines are also retained
  • If you need to keep long lines, please use "Only keep lines longer than N characters"

Upper limit vs. lower limit comparison

Length filtering has two directions: the upper limit removes overly long lines, and the lower limit removes overly short lines; if you know the direction clearly, you won't use the wrong tool.

📌 Can the two be used together?

Yes, in two steps: first use this page (upper limit) to filter out overly long lines, and then use "retain only lines longer than N characters" (lower limit) to filter the results again to get the lines within the range. Note that the second threshold is 1 smaller than the first to include situations equal to the boundary.

🧭 Common uses

It is common to clean up truncated over-long lines in the data (such as log truncation and dirty lines caused by over-long fields), retain only numbers whose specifications meet the length requirements, pick out short labels or short descriptions from mixed text, and remove overly long paragraphs before doing statistics; because the judgment is only based on length, the processing rules are clear and can be reproduced repeatedly.

🔒 Dealing with location and privacy

The filtering is completed locally in the browser, and the input and results are not uploaded to the server or written to local storage, and will be cleared when the page is refreshed. The deleted rows remain in the original document, and can be re-screened by changing a threshold.

All keywords and tutorials 12

❓ FAQ

Which step is better to do first?
It is recommended to do the upper limit first and then the lower limit. The intermediate results will be shorter and processed faster.
How to connect intermediate results
Paste the result of the previous step back into the input box, and then perform the next step.
Operation sequence of interval filtering
Upper limit filter → result backfill → lower limit filter → check interval.