blob: 1f651b93648e1699716bf17d1ebd5fd8ae48ccaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#!/bin/bash
# arg 0: path, arg 1: input file; arg 2: output file
#-- save arguments for use
args=("$@")
path=${args[0]}
file=${args[1]}
outputfile=${args[2]}
cd ${path}
cp ${file} tmp.txt
#echo "__ ORIGINAL: $file ___"
#cat tmp.txt
#echo " "
#echo "__ removed accents: __"
perl -p -i -e " s/\\\'e/e/g " tmp.txt
perl -p -i -e " s/\\'{e}/e/g " tmp.txt
perl -p -i -e " s/\\\`e/e/g " tmp.txt
perl -p -i -e ' s/\\"e/e/g ' tmp.txt
perl -p -i -e " s/\\\`{e}/e/g " tmp.txt
perl -p -i -e " s/\\\'a/a/g " tmp.txt
perl -p -i -e " s/\\\`a/a/g " tmp.txt
perl -p -i -e " s/\\\`{a}/a/g " tmp.txt
perl -p -i -e ' s/\\"{o}/oe/g ' tmp.txt
perl -p -i -e ' s/\\"o/o/g ' tmp.txt
perl -p -i -e ' s/\\o{}/o/g ' tmp.txt
perl -p -i -e ' s/\\\^o/o/g ' tmp.txt
perl -p -i -e " s/\\\'o/o/g " tmp.txt
perl -p -i -e " s/\\\`o/o/g " tmp.txt
perl -p -i -e " s/\\\'u/u/g " tmp.txt
perl -p -i -e ' s/\\u //g ' tmp.txt
perl -p -i -e ' s/\\"u/u/g ' tmp.txt
perl -p -i -e ' s/\\i /i/g ' tmp.txt
perl -p -i -e ' s/\\i/i/g ' tmp.txt
perl -p -i -e " s/\\\'{i}/i/g " tmp.txt
perl -p -i -e ' s/\\"{i}/i/g ' tmp.txt
perl -p -i -e ' s/\\c {c}/c/g ' tmp.txt
#echo " "
#echo "__ removed textit, texbf, {, }: __"
perl -p -i -e ' s/\--/-/g ' tmp.txt
perl -p -i -e " s/\\ss/ss/g " tmp.txt
perl -p -i -e ' s/\\textsuperscript //g ' tmp.txt
perl -p -i -e " s/\\&/&/g " tmp.txt
perl -p -i -e ' s/\\mu/mu\:/g ' tmp.txt
perl -p -i -e ' s/\\sim\s//g ' tmp.txt
perl -p -i -e ' s/\\sim//g ' tmp.txt
perl -p -i -e ' s/\s:/:/g ' tmp.txt
perl -p -i -e ' s/\$//g ' tmp.txt
perl -p -i -e " s/textit //g " tmp.txt
perl -p -i -e " s/textbf //g " tmp.txt
perl -p -i -e " s/\{//g " tmp.txt
perl -p -i -e " s/\}//g " tmp.txt
perl -p -i -e ' s/\`\`/"/g ' tmp.txt
perl -p -i -e " s/\'\'/\"/g " tmp.txt
#echo " "
#echo "__ removed \: ___"
perl -pi -e 's/\\//g' tmp.txt
perl -pi -e 's/\s{2,10}\{\}/ /g' tmp.txt
perl -pi -e 's/\s{2,10}/ /g' tmp.txt
cp tmp.txt $outputfile
|