This question/answer is nearly exactly what I want to do.
However, I wish to change the sed line to turn something like this:
if(something)
{
// whitespace // code in braces of this style
}
into something like this:
if(something) {
// whitespace // code in braces of some other style
}
i.e. I want the sed line to format code that has been indented to the right of the page too.
I’m new to sed so don’t know about how you’re meant to do this.
Here’s the current sed line: sed 'N;/\n{/s// {/;P;D' $file
Thank you :).
Does just adding ” *” help?