So i discovered that I basically use this blog myself because I don't remember my own scripts (I am a really confused worker) so here's is another that took me 15 min to remember and re write:
#!/bin/bash
for d in */; do
awk '(NR>1) {print $1 "\t" $3 }' ${d}statistics > dij${d%/}
awk '(NR>1) {print $1 "\t" $7 }' ${d}statistics > kij${d%/}
head -n -2 dij${d%/} > temp; mv temp dij${d%/}
head -n -2 kij${d%/} > temp; mv temp kij${d%/}
done
Visualizzazione post con etichetta S-Cryptic. Mostra tutti i post
Visualizzazione post con etichetta S-Cryptic. Mostra tutti i post
lunedì 29 agosto 2016
lunedì 8 febbraio 2016
Skullbasher and Scriptbasher
Then comes the time when you need to use a program (PowDog) that takes as input only file with format .qpow and you only have the .xyz files.
Moreover this program wants as inline command the atom element. So you script something with bash that transforms .xyz into .qpow and then starts the program N times with different inline command each time.
#!/bin/bash
for f in *.xyz; do
Moreover this program wants as inline command the atom element. So you script something with bash that transforms .xyz into .qpow and then starts the program N times with different inline command each time.
Mission accomplished.
#!/bin/bash
for f in *.xyz; do
awk '{t=$1; $1=$2; $2=$3; $3=$4; $4=t; print }' $f > $f.qpowd
done
for f in *.qpowd; do
#the "${f%%-*}" only takes the first 2 characters of the file's name
./powdog -i $f -F form.factor -e "${f%%-*}"
done
Iscriviti a:
Post (Atom)