How to get the string prefixed with “Mat” within curly braces {} and print with the addition of a comma?
e.g.
in:
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
import { RouterOutlet } from '@angular/router';
out:
MatSidenavModule,
MatToolbarModule,
I tried:
awk -F"[{}]" 'BEGIN {/Mat/} {gsub(/ /, "", $2); print $2","}' in
GNU Awk version is 5.0.1.