I want to convert several files in a project from camelCase to underscore_case.
camelCase
underscore_case
I would like to have a onliner that only needs the filename
The proposed sed answer has some issues:
sed
$ echo 'FooBarFB' | sed -r 's/([a-z0-9])([A-Z])/\1_\L\2/g' Foo_bar_fB
I sugesst the following
$ echo 'FooBarFB' | sed -r 's/([A-Z])/_\L\1/g' | sed 's/^_//' foo_bar_f_b