문제

.[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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top