Catman...::DKVP(3pm)

πŸ“¦
version 1.2025 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Catmandu::Importer::DKVP β€” it's the Delimited Key-Value Pairs importer, bestie πŸ’… and yes she lives in the User Contributed Perl Documentation section of your manual, page Catman...::DKVP(3pm) if you're keeping receipts.


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this package imports text files full of delimited key-value pairs. That's it, that's the whole vibe. Every line is a little bundle of key=value moments, separated by commas, and she eats them up and hands you back tidy records. No cap.

Here's literally what the input looks like:

a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797
a=wye,b=wye,i=3,x=0.20460330576630303,y=0.33831852551664776

See? Keys on the left, values on the right, commas holding it all together like a group chat. 🫢


πŸŽ€ CONFIGURATION πŸŽ€

Two little knobs, both iconic, both customizable:

  • sep_char β€” the character that separates fields from each other. Default is ",". So like, if you're feeling spicy and want semicolons or whatever, this is your girl.
  • pair_sep_char β€” the character that separates key-value pairs, i.e. the thing sitting between the key and its value. Default is "=". Change it if = isn't giving what it needs to give.

πŸ’– METHODS πŸ’–

Every Catmandu::Importer is a Catmandu::Iterable, and all their methods are inherited. So whatever your importer can do, this one can do too β€” she's got main character energy by association, periodt. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

Miller β€” and here's the link, character for character, because I don't make the rules:

http://johnkerl.org/miller/doc/file-formats.html#DKVP:_Key-value_pairs


k bye bestie, this page was brought to you by perl v5.40.1, dated 2026-01-24, and the whole Catman...::DKVP(3pm) moment. go slay some delimited data πŸ’œβœ¨

πŸ“¦ where this page comes from