-
Notifications
You must be signed in to change notification settings - Fork 0
CLI: Auto-split comma-separated values in put command #186
Copy link
Copy link
Open
Description
Summary
When using put with a range and comma-separated values, the CLI currently treats the entire string as a single text value:
xl -f file.xlsx -s Sheet1 -o out.xlsx put A1:A5 1,2,3,4,5
# Current: All 5 cells get text "1,2,3,4,5"
# Expected: A1=1, A2=2, A3=3, A4=4, A5=5Proposed Behavior
When the number of comma-separated values matches the number of cells in the range, distribute values across cells with smart type detection.
Considerations
-
Ambiguity: What if someone wants literal text "1,2,3,4,5"?
- Option A: Add
--no-splitflag to preserve literal behavior - Option B: Only split when count matches exactly, otherwise treat as text
- Option C: Require quotes for literal text:
put A1 '"1,2,3,4,5"'
- Option A: Add
-
Smart detection: Apply same auto-detection as batch JSON (numbers, dates, currency, percent)
-
Edge cases:
- Quoted values with commas:
"Hello, World",Foo,Bar - Trailing/leading whitespace handling
- Empty values:
1,,3(should become 1, empty, 3?)
- Quoted values with commas:
Workaround
Use batch JSON syntax which already supports this:
echo '[{"op":"put","ref":"A1","value":1},{"op":"put","ref":"A2","value":2}]' | xl -f file.xlsx -s Sheet1 -o out.xlsx batch -Priority
Low - ergonomics improvement, not a blocker.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels