Reputation: 648
.[string 10#.z.d;(til 10;4 7);:;"-"]
Does what I want; it replaces char 4 and 7 for each element in a list of dates with "-".
I seem to remember it being possible to elide the top level index (i.e. til 10
) in some way. I would expect the below to work, but it doesn't:
.[string 10#.z.d;(0N;4 7);:;"-"]
How can I elide the top level index in dot-amend?
Upvotes: 1
Views: 138
Reputation: 2605
q).[string 10#.z.d;(::;4 7);:;"-"]
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
"2014-04-22"
Same behaviour as when indexing lists:
q)l:1 2 3
q)l[::]
1 2 3
Upvotes: 2