in reply to Perl comes to rescue once again.
“Welcome to Perl.” Very soon, you will see for yourself why the language has been called “The Swiss Army® Knife of Computer Programming.” All those many years ago, a fellow named Larry Wall was faced with issues very much like these ... and they are, indeed, universal ... and, well, “one thing led to another,” and The Rest Is History.™ He wrote the tool that he needed, then he released it to the world, and the world took over from there.
If your exposure to programming, up to this point, was “C/C++,” well, you quite-understandably might have presumed that “to do anything (useful), you must do it yourself.” As you now see, the truth of the matter is that marvelous programs, such as ... say ... perl ... have been built using those more-primitive language tools. Therefore, “you can stand upon the shoulders of giants.”
The “P” in Perl could stand for “practical” or “pragmatic.” Either one will suffice. For real-world, boots-on-the-ground, purposes just like the ones that you have encountered ... and just like the ones that so many of all-of-us likewise face every day ... the Perl language is “a helluva power-tool.”