سؤال

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