Support slice operator
This is reasonable. The index current index operator has a syntax of:
index(0)
index(0,1,2)
[0]
[0,1,2] <-- I've spotted an issue that could stop this from working, but this is the intended format.
A proposed syntax for the slice operator may be:
slice(1,5), [1...5] - Index 1 through 5
slice(*,5), [*...5] - All indexes up to 5
slice(1,*), [1...*] - Index 1 to the end of the list
Any feedback on this? I'm open to any other syntax that makes sense
jq -r '.province[:-1] + .city[:-1]'
.province[:-1] extracts the value of the "province" field and removes the last character
.city[:-1] extracts the value of the "city" field and removes the last character
The + operator concatenates the modified values together
To remove the first two characters from the "province" and "city" fields using jq, you can modify the command as follows:
jq -r '.province[2:] + .city[2:]'
We can do something similar. It'll be a little more long form because the join func doesn't have shorthand right now, but something like:
dasel -r json `join(province[2:],city[2:])`