ODFSEARCH(1p)

πŸ“¦
version 2.125 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

🌸 NAME 🌸

odfsearch β€” text selection and copy from one document to another using callback πŸ’–

Like, okay, bestie, listen. This one's a lil script that goes shopping through one doc, grabs the bits you asked for, and drops them into a whole other doc. Using a callback. Iconic behavior, honestly.


✨ SYNOPSIS ✨

So here's the whole vibe: this sample script extracts the content of every text element β€” and by every text element I mean literally every one, the paragraph, the header, and the list item β€” inside a source document that matches a given pattern. And that pattern can be a plain old string or a full regex, whatever your heart desires. πŸ¦‹

Then, once it's got those matches? It appends them as a new paragraph to a target document. That's the whole trick. No cap. πŸŽ€

🚨 Bestie. Real talk. The target document must exist. Like, it has to actually be there. No ghost files, no vibes-only documents. 🫢

Also the target document must exist β€” and yes I'm repeating myself on purpose because it matters β€” and the good news is it can be an empty document or a template, so you have options, queen. ✨

And here's how you actually call it, character for character, don't @ me:

usage : odfsearch target_file source_file "search_string"

That's target_file first, then source_file, then your "search_string" in quotes. Order matters, slay accordingly. πŸ’…


Okay that's the whole page!! Go forth and copy text between docs like the main character you are πŸ‘‘ πŸ¦‹πŸŒΈπŸ’œ

This lil writeup is from the perl v5.34.0 era, dated 2022-06-16, and it's part of the ODFSEARCH(1p) manual, filed under User Contributed Perl Documentation. Byeee! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from