Using sed
:
sed 's/^\( *\)title=\(.*\),/\1title={\\textbf\2},/' in
To edit the file inplace instead of printing the edited file to stdout
, add the -i
option:
sed -i 's/^\( *\)title=\(.*\),/\1title={\\textbf\2},/' in
\( *\)
: matches and groups any number of
characters at the start of the line;
title=
: matches a ^title=
string;
\(.*\),
: matches and groups any number of any character before a ,
character greedily and a ,
character;
title={\\textbf\1},
: replaces the match with a title={\textbf
string followed by the captured group followed by a },
string;
% cat in
@inproceedings{lechartier2014static,
title={Static and Dynamic Modeling of a PEMFC for Prognostics Purpose},
author={Lechartier, Elodie and Gouriveau, Rafael and Pera, Marie-Cecile and Hissel, Daniel and Zerhouni, Noureddine},
booktitle={Vehicle Power and Propulsion Conference (VPPC), 2014 IEEE},
pages={1--5},
year={2014},
organization={IEEE}
}
@inproceedings{zein2013statistical,
title={Statistical approach to online prognostics of turbine engine components},
author={Zein-Sabatto, Saleh and Bodruzzaman, Jabir and Mikhail, Mervat},
booktitle={Southeastcon, 2013 Proceedings of IEEE},
pages={1--6},
year={2013},
organization={IEEE}
}
% sed 's/^\( *\)title=\(.*\),/\1title={\\textbf\2},/' in
@inproceedings{lechartier2014static,
title={\textbf{Static and Dynamic Modeling of a PEMFC for Prognostics Purpose}},
author={Lechartier, Elodie and Gouriveau, Rafael and Pera, Marie-Cecile and Hissel, Daniel and Zerhouni, Noureddine},
booktitle={Vehicle Power and Propulsion Conference (VPPC), 2014 IEEE},
pages={1--5},
year={2014},
organization={IEEE}
}
@inproceedings{zein2013statistical,
title={\textbf{Statistical approach to online prognostics of turbine engine components}},
author={Zein-Sabatto, Saleh and Bodruzzaman, Jabir and Mikhail, Mervat},
booktitle={Southeastcon, 2013 Proceedings of IEEE},
pages={1--6},
year={2013},
organization={IEEE}
}