I have a file containing text
**This is bold text**
*This is italicized text*
I wish to convert the above into
\textbf{This is bold text}
\emph{This is italicized text}
using stream editor(sed). Kindly guide me on this matter.
I have used this code
sed -i 's/\*\*\(.*\)\*\*/\\textbf{\1}/g' SampleCode
and it works like a charm
Thanks from Google group
It looks like you are trying to invent new Pandoc.
Instead:
Install Pandoc:
Create input file:
Run conversion from Markdown to LaTeX:
Enjoy the result:
This is the simple answer:
Most important thing is to understand regular expressions. There are several online regex testers where you can experiment with regex.
Here is a very good explanation of sed. https://www.grymoire.com/Unix/Sed.html