Batch convert eps files to svg using pstoedit

Alec Jacobson

December 08, 2009

weblog/

My student mac version of MATLAB won't print to svg so I'm stuck with a bunch of eps files. I needed a way to batch convert all my MATLAB plots to svg. First step: get pstoedit, on a mac I just issue:
sudo port install pstoedit
On linux you can probably do
sudo apt-get install pstoedit
Then in a bash terminal using the same idea as an earlier post you can issue:
for filename in *.eps; \
do newname=`echo $filename | sed 's/\.eps$/.svg/g'`; \
pstoedit -f plot-svg $filename $newname; \
done