Skip to content

Instantly share code, notes, and snippets.

@theJohnnyBrown
Created February 24, 2022 14:49
Show Gist options
  • Select an option

  • Save theJohnnyBrown/9a87ed19ebdce51ac4f9e6a2fb11e16b to your computer and use it in GitHub Desktop.

Select an option

Save theJohnnyBrown/9a87ed19ebdce51ac4f9e6a2fb11e16b to your computer and use it in GitHub Desktop.
(for [parcel ["1-22-44-32-010-0027-0040"
"1-22-44-32-010-0083-0100"
"1-26-44-32-A00-0036-0000"
"1-26-44-32-A00-0047-0100"
"1-35-44-32-A00-0015-0100"
"4-10-43-29-120-2481-0090"
"3-01-43-34-010-0354-0081"
"1-13-44-32-A00-0227-0100"
"3-02-43-34-460-000C-0050"
"1-21-43-34-040-000B-0020"
"1-36-44-32-A00-0213-0000"
"2-01-43-29-010-0104-0050"]]
(let [parts (string/split parcel #"-")]
(string/join
"-"
(concat
(take 1 parts)
(->> parts (drop 1) (take 3) reverse)
(drop 4 parts)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment