-
Hey there. I am having a bit of a problem with the DSL here. Provided that the string manipulation functionality is often rather clunky in miller (haven't looked at version 6, hopefully it gets better :D ) I am stumped looking in the documentation for what I described in the title.
to split string on I think that the answer, after scrolling through all the functions, might be to use @johnkerl what am I missing? update
does what I need, but I believe my concern on the clarity of such a construct and/or its documentation as a pattern might be valid anyway. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Thanks @trantor -- Miller pre-6's lack of arrays and slicing is indeed frustrating. I ended up doing lots of things to make integer-keyed maps fill some gaps but (as you found) it's awkward. In Miller 5 I think your In Miller 6 (using the REPL to interact):
So, in short, As a side note, strings can be sliced in Miller 6, as well. You can check out the Miller-6 arrays page: https://johnkerl.org/miller6/reference-main-arrays/ The MIller-6 strings page is still a bit under construction: https://johnkerl.org/miller6/reference-main-strings/ |
Beta Was this translation helpful? Give feedback.
Thanks @trantor -- Miller pre-6's lack of arrays and slicing is indeed frustrating. I ended up doing lots of things to make integer-keyed maps fill some gaps but (as you found) it's awkward.
In Miller 5 I think your
$host = joinv(mapselect(splitnvx($2,"-"),1,2),"-")
is about as good as it gets.In Miller 6 (using the REPL to interact):
So, in short,
join…