Column Type Inference From Sample

Infer empty, integer, decimal, or string from a column sample using ASCII decimal token syntax; blanks are ignored and leading-zero identifiers remain strings.

Description

Column type inference is a rule applied to a sample rather than a guarantee about a whole dataset.

Column type inference is a rule applied to a sample rather than a guarantee about a whole dataset. Keeping leading-zero identifiers as strings helps avoid losing meaningful spelling when cells resemble numbers.1

Infer empty, integer, decimal, or string from a column sample using ASCII decimal token syntax; blanks are ignored and leading-zero identifiers remain strings.

When to use Column Type Inference From Sample

Use this tool to infer empty, integer, decimal, or string from a column sample using ASCII decimal token syntax; blanks are ignored and leading-zero identifiers remain strings.

Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.

How to use Column Type Inference From Sample and understand its results

  1. Choose the original CSV text, decoded cell strings, byte values or counts requested by this tool. Use the stated delimiter, encoding, indexing and number/date convention.
  2. Enter values using the field table and calculation rules, then run the tool.
  3. Read kind, observedCount. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
valuesValueslist of string; maximum length: 10000; minimum entries: 0; maximum entries: 10000Required

Provide cell strings. After trimming, blank tokens are ignored. A signed ASCII integer must have either a single 0 or a nonzero first digit; a decimal must have the same integer part, a dot and at least one fractional digit. If any observed token fails these numeric patterns, kind is string; otherwise any decimal makes kind decimal and the rest are integer. observedCount excludes blank cells.

kind = empty if no observations; otherwise string > decimal > integer by precedence

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
kindKindstring; one of empty, integer, decimal, string
observedCountObserved countinteger; minimum: 0; maximum: 9007199254740991
json
{
  "input": {
    "values": [
      "12",
      "3.5",
      ""
    ]
  },
  "output": {
    "kind": "decimal",
    "observedCount": 2
  }
}

Limitations and assumptions

Tokens are classified by spelling without numeric conversion or safe-integer magnitude checks. Exponents, decimal commas, grouping, dates, booleans and leading-zero multi-digit tokens are strings. A sample's inferred kind may not describe unsupplied rows.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Cell-string lists also have a combined text budget of 100,000 UTF-16 units per list. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use Decimal Separator Dot vs Comma Detector: List decimal separator profiles compatible with all nonblank cells, allowing opposite-character thousands grouping; ambiguous values such as 1,234 keep both interpretations. For a complementary task, use Leading-Zero ZIP Code Loss Warner: Flag original five-digit or ZIP+4-shaped cells beginning with zero as susceptible to numeric-import loss; this is a spelling warning rather than postal-code assignment validation.

References

  1. Column Type Inference From Sample — tool.io

Similar or alternative tools

  • Decimal Separator Dot vs Comma Detector

    List decimal separator profiles compatible with all nonblank cells, allowing opposite-character thousands grouping; ambiguous values such as 1,234 keep both interpretations.

  • Leading-Zero ZIP Code Loss Warner

    Flag original five-digit or ZIP+4-shaped cells beginning with zero as susceptible to numeric-import loss; this is a spelling warning rather than postal-code assignment validation.

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