I have a list of C++ source files, which have the following structure:
// A lot of stuff
#include <current/parser/support/base.hpp>
// ...
#include <current/parser/iterators/begin.hpp>
// ...
I need to replace lines like
#include <current/parser/support/base.hpp>
with
#include <support_base.hpp>
Namely, omit the current/parser and replace the separator (/) with _.
Is this possible to do with bash sed or a scripting language?
EDIT: Sorry, forgot to mention that I want to replace anything like
#include <current/parser/*/*/*/*>
Anything can go after current/parser, and with any depth.
current/parseror all the ones containing any#include <anypath/last/file.hpp>?#include <*_*_*_*>as output?