atat-mirror/glue/vasp/xdat2str

36 lines
530 B
Plaintext
Raw Permalink Normal View History

2023-08-31 20:30:18 +02:00
#!/bin/csh
awk '\
BEGIN {\
while (1) {getline; if ($0==" ") break;}\
nbsp=0;\
while (1) {\
getline < "header.in";\
if ($1=="end") break;\
for (i=0; i<$2; i++) {\
sp[nbsp]=$1;\
nbsp++;\
}\
}\
nbh=0;\
while (1) {\
getline < "header.in";\
if ($1=="end") break;\
h[nbh]=$0;\
nbh++;\
}\
at=0;\
}\
{\
if (at==0) {\
for (i=0; i<nbh; i++) {print h[i];}\
}\
print $0,sp[at]\
at++;\
if (at==nbsp) {\
at=0;\
print "end";\
print "";\
getline;\
}\
}'