Numeric Sort EU Decimal-Aware

Stably sort rectangular CSV rows by exact numbers using comma decimals and optional dot groups of three, preserving original cell spelling and an explicit header.

Description

Locale-style numeric cells can use comma decimals and dot grouping.

Locale-style numeric cells can use comma decimals and dot grouping. Exact numeric sorting should preserve original cell spellings and tied row order.1

Stably sort rectangular CSV rows by exact numbers using comma decimals and optional dot groups of three, preserving original cell spelling and an explicit header.

When to use Numeric Sort EU Decimal-Aware

Use this for the following task: Stably sort rectangular CSV rows by exact numbers using comma decimals and optional dot groups of three, preserving original cell spelling and an explicit header.

Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.

How to use Numeric Sort EU Decimal-Aware and understand its results

  1. Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
  2. Enter csv, delimiter, hasHeader, column, direction using the field table, then run the tool.
  3. Read csv. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
csvCSV textstring; maximum text length 100000Required
delimiterDelimiterstring; choose ",", ";", "\t"Required
hasHeaderHas headerbooleanRequired
columnColumninteger; minimum 0Required
directionDirectionstring; choose "ascending", "descending"Required

Parse rectangular records with an explicit header. Validate the selected zero-based column for every data row, sort exact scaled decimal values in the selected direction and retain original order for equal keys.2

Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.

The shared writer doubles interior quotes and quotes cells when needed for delimiters or line breaks, including a single empty-field record. It normally emits LF record endings without a terminal newline; any tool-specific quote-all behavior is stated above.

sort key = exact comma-decimal value with optional three-digit dot grouping

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
csvCSV textstring
json
{
  "input": {
    "csv": "id;amount\na;1.234,50\nb;9,75\nc;9,750",
    "delimiter": ";",
    "hasHeader": true,
    "column": 1,
    "direction": "ascending"
  },
  "output": {
    "csv": "id;amount\nb;9,75\nc;9,750\na;1.234,50"
  }
}

Limitations and assumptions

Blank or malformed numeric keys are errors. This does not infer locale or convert the cell spelling. Decimal parsing trims outer whitespace, requires digits before the separator and limits a numeric token to 200 characters.

Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.

Alternative or Complementary methods

Choose Sort Rows Column Lexicographic for this operation: Stably sort CSV data records by a selected column using deterministic UTF-16 code-unit ordering, with an explicit direction and header flag. For a complementary task, use Thousands Separator Detector for this operation: List comma, dot, or ASCII-space grouping profiles observed in a numeric column sample, requiring groups of three digits; report when the same sample also permits a decimal-only interpretation.

Further background: Format and language reference: Numeric Sort EU Decimal-Aware.

References

  1. Format and language reference: Numeric Sort EU Decimal-Aware — RFC Editor

  2. Numeric Sort EU Decimal-Aware — tool.io

Similar or alternative tools

  • Sort Rows Column Lexicographic

    Stably sort CSV data records by a selected column using deterministic UTF-16 code-unit ordering, with an explicit direction and header flag.

  • Thousands Separator Detector

    List comma, dot, or ASCII-space grouping profiles observed in a numeric column sample, requiring groups of three digits; report when the same sample also permits a decimal-only interpretation.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies