CSV clamp integer column
csv-clamp-integer-column · version 1.0.0 · CSV & tables · free, no key needed
Clamp every data cell in a named CSV column to optional canonical integer min and max bounds.
Use when you need to: csv clamp integer column · clamp csv integer column · bound csv integer column.
Supported
- csv clamp integer column
- clamp csv integer column
- bound csv integer column
Not supported
- floating point clamp
- percentile clip
- infer bounds
- trim cells
- read files
- fetch urls
Behavior
- The first CSV record is the header row. Duplicate and empty header names are rejected.
- column names an existing header exactly; no trimming, case folding, or fuzzy matching.
- At least one of min and max is required. Both are canonical integer strings. If both are present, min must be less than or equal to max.
- Every data cell in column is a canonical integer string parsed with BigInt. Empty cells and non-integers are invalid. -0 is accepted and canonicalized to 0.
- Each output cell is min if the value is below min, max if the value is above max, otherwise the canonicalized input.
- An empty document without a header is rejected. A header-only document is returned unchanged.
- Other columns and row order are preserved. The first output header name may not begin with U+FEFF.
Input
csv(string, required): max length 256000column(string, required): min length 1; max length 256min(string, optional): min length 1; max length 1001max(string, optional): min length 1; max length 1001
Output
csv(string, required)
Limits
- max input bytes: 256000
- max data rows: 5000
- max columns: 256
- max header name bytes: 256
- max integer digits: 1000
- max output bytes: 256000
Example
Request input:
{
"csv": "n,label\n-5,a\n3,b\n10,c\n",
"column": "n",
"min": "0",
"max": "8"
}
Response:
{
"result": {
"csv": "n,label\n0,a\n3,b\n8,c\n"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "csv-clamp-integer-column",
"version": "1.0.0",
"input": {
"csv": "n,label\n-5,a\n3,b\n10,c\n",
"column": "n",
"min": "0",
"max": "8"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/csv-clamp-integer-column/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"csv":"n,label\n-5,a\n3,b\n10,c\n","column":"n","min":"0","max":"8"}'
The machine-readable contract is at /v1/tools/csv-clamp-integer-column/versions/1.0.0.
CLI
node cli.mjs run csv-clamp-integer-column 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- CSV abs integer column: Replace every data cell in a named CSV column with the absolute value of a canonical integer.
- CSV scale integer column: Multiply every data cell in a named CSV column by a canonical integer factor.
- CSV sum integers: Sum a CSV column of strict signed base-10 integer strings using BigInt.
- CSV distinct values: List distinct exact values of one CSV column in first-seen order.
- CSV filter equals: Keep CSV data rows whose named column equals an exact string.
- CSV min max integers: Minimum and maximum of a CSV column of strict signed base-10 integer strings.