-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange_names.sct
executable file
·34 lines (34 loc) · 963 Bytes
/
change_names.sct
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
#!/bin/bash
alphabet=( {a..z} {A..Z} )
function convertToString(){
dividend="$1"
colName=""
size=${#alphabet[@]}
while (( dividend > 0 ))
do
mod=$(( (dividend-1)%size ))
colName="${alphabet[$mod]}$colName"
dividend=$(( (dividend-mod)/size ))
done
}
#IRMOF10_SG202_Ligand3_202_y.cif
for structure in "202" ; do
folder=mof_${structure}_cif_gin_all
cd $folder
for file in IRMOF10_*.cif ; do
new_file=$(echo $file | sed 's/IRMOF10_SG202/mof_int/g' | sed 's/Ligand3../li3/g' | sed 's/Ligand4../li4/g' | sed 's/Ligand11../li5/g'| sed "s/label/$structure/g" | sed 's/202/I10/g' )
echo "$file > $new_file"
mv $file $new_file
done
cd ..
done
for topology in "202" ; do
for nlig in 3 4 5 ; do
h=0
for file in mof_${topology}_cif_gin_all/mof_int_li${nlig}_I10_?_?.cif ; do
let h++
convertToString $h
mv $file mof_${topology}_cif_gin_all/mof_int_li${nlig}_I10_${colName}.cif
done
done
done