Groupgrain

Method

Read the fields.
Group the exact keys.

Groupgrain combines one small pasted table into per-key counts and exact decimal sums. It does not guess which records to clean, normalize or exclude.

Paste, read columns, calculate

The first record is always the required header. Paste the complete text, press Read columns, then choose a key column and a different numeric-value column. Calculate totals validates every selected numeric value and produces the complete result. Read columns checks table structure; it does not yet approve the values for aggregation.

Each selector uses a numbered position followed by the header label. Blank or duplicate names therefore remain unambiguous. Long labels are shortened in the dropdown only; the complete original header labels and positions remain in the local notes. A changed CSV clears those selections so a previous header cannot silently govern a different table.

The accepted bounded CSV dialect

A comma separates fields. A field can be enclosed in double quotes; inside it a doubled quote represents one quote. Quoted fields can contain commas and line breaks. Bare quotes in an unquoted field, an unclosed quote or any text after a closing quote before a separator are rejected. Even a space after a closing quote is not accepted.

Record endings outside quotes may be CRLF or LF. A lone CR outside quotes is rejected. One optional leading BOM is ignored; a second consecutive leading BOM is rejected. Unicode text and ASCII tabs in fields are accepted as explicit local-text extensions. This is not a promise to accept every spreadsheet export or CSV dialect.

A single final record terminator does not create an extra data record. A second final blank record is not skipped: it must have the header's field count and a valid selected number. Every record must have the same number of fields as the header. Errors refer to logical records, with header = record 1, rather than physical display lines; a quoted key may span several lines within one record.

Exact keys mean unchanged decoded text

After quote decoding, the selected key is used unchanged. Case, leading/trailing spaces, empty text, line endings and Unicode normalization form all matter. A key named __proto__ or constructor is ordinary Map text, and a formula-looking key is not evaluated. The interface renders keys using text nodes rather than HTML.

The table JSON-quotes key text so surrounding spaces and embedded line breaks are easier to inspect. The empty key has an explicit label, while its exact exported value remains the empty string. Visually similar Unicode strings can still be different keys. No fuzzy matching, case folding or normalization is performed.

The parser preserves the text it receives. Browser textareas can normalize pasted line endings before the script sees them; this tool cannot recover original clipboard or file bytes. There is no file upload or encoding detector.

Exact signed decimal values

Only the selected numeric field is interpreted as a number. Outside ASCII spaces and tabs are removed from that field alone. It then needs digits, an optional leading minus and an optional decimal fraction with at most twelve digits. Write 0.5 rather than .5. Plus signs, exponents, separators, units, blank values and Unicode whitespace substitutions are rejected. Negative zero becomes zero.

The maximum absolute value of each selected input is 1000000000000. Sums may exceed that input bound because many valid records can contribute. A value such as 0.1 is represented by an exact scaled integer at 10¹² units per whole number. Group and grand sums add those integers, then format the result as an exact decimal. No binary floating-point addition or display rounding decides a total.

Counts and complete totals

Groups follow the first appearance of each exact key. Every successfully parsed data record contributes one count and one selected value, including a zero value. The total of the group counts must equal the number of data records; the sum of all group totals must equal the direct grand sum. If a numeric value is invalid, there is no partial successful result and no silent omission.

The result table shows up to 100 groups per page. Previous groups and Next groups expose the remaining groups in that same order. The grand counts, grand sum and text/JSON reports always include every group, not just the current table page.

Product bounds and scope

Edits, reset and local reports

Editing the pasted text immediately clears results, export payloads and old column choices. Editing a selector clears the result but retains the parsed table. Calculate totals must succeed before exports are enabled. Reset example restores the original five-record craft table and recalculates it.

Copy all group notes and optional text/JSON downloads include exact keys, selected positions, original header labels, counts, sums and assumptions. Text notes JSON-escape keys so embedded line breaks stay represented within one record note. There is no CSV/spreadsheet export or formula interpretation. If you later paste text into another application, that application's rules apply.

Primary reference context

RFC 4180 supplies the informational comma/quote/record context. RFC 7111 updates the text/csv media-type context. The explicit bounds, required header, LF/BOM/Unicode handling and grouping behaviour described here are this product's choices.

The official Python CSV documentation informs a separate valid-fixture test oracle; Python is not a runtime dependency. Permissive library acceptance is not used to excuse malformed quote states in this strict dialect. Read the original examples or return to the calculator.