text_line_counter
Count and analyze text lines: returns total, non-empty, blank lines, line-length statistics, length distribution, and optional line numbering.
Instructions
Count And Analyze Text Lines. Count and measure the lines of a text block: returns total lines, non-empty lines, blank lines, and line-length stats (max/min/average length plus the 1-based line numbers of the longest and shortest lines) and a length-bucket distribution. Optionally returns the text with line numbers prepended. Use this for line-focused metrics; use text_counter or text_text_statistics for word, character, sentence, and readability metrics, or text_sort_lines to reorder lines. It does NOT deduplicate or detect duplicate/unique lines. Pure local compute: read-only, non-destructive, offline, rate-limited (60 requests/minute for anonymous callers). Returns a stats object, an optional numberedText string, and a lengthDistribution array.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to analyze; split into lines on newline. Empty input yields zeroed stats. | |
| showLineNumbers | No | When true, numberedText prepends a right-padded line number (e.g. " 1: line") to each line; otherwise numberedText echoes the input unchanged. | |
| skipBlankLines | No | When true (and showLineNumbers is true), blank/whitespace-only lines are emitted verbatim and not assigned a number. Does not affect the stats counts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Always true on success. | |
| stats | No | Line metrics for the input. | |
| numberedText | No | Input with line numbers prepended when showLineNumbers is true; otherwise the input verbatim. Empty for empty input. | |
| lengthDistribution | No | Line-length buckets (0-20, 21-50, 51-80, 81-120, 120+); empty buckets omitted. | |
| options | No | Echo of the effective request options. |