I'm trying to run the following loop but unfortunately it creates empty files.
for f in *.tex; do cut -d "&" -s -f1,2,4 $f | sed "s/$/\\\\\\\\/g" | sed "s/Reg. year/\$year/g" | sed "s/=\([0-9]\{4\}\)/^\{\1\}\$/g" | sed "/Counterfactual/d" | sed "/Delta/d" | sed "/{2014}/d" | sed "/^\s*&\s*\&/d" > $f; done;
When I run the command on a single file (replacing $f by filename.ext), it does work well.