I have a folder /myfolder
containing many latex tables.
I need to replace a character in each of them, namely replacing any minus
sign -
, by an en dash
–
.
Just to be sure: we are replacing hypens INSIDE all of the tex file in that folder. I dont care about the tex file names.
Doing that manually would be a nightmare (too many files, too many minuses). Is there a way to loop over the files automatically and do the replacement? A solution in Python/R would be great.
Thanks!
sed
command. One example there: cyberciti.biz/faq/unix-linux-replace-string-words-in-many-files. If you don't like bash scripts, you can make an R loop that system-callssed
:') – F. Privé Jul 9 '17 at 13:25system("sed -i -e 's/-/–/g' /myfolder/*")
should work in R. Maybe using*.tex
would be better. – F. Privé Jul 9 '17 at 13:30