Open babel can do it for you.<div><br></div><div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>First all you need is to create a .xyz file then convert to PDB format. After this, you just need do add an extra line with the crystal cell.</div>
<div><br></div><div>I am pretty sure you can create your own shell script using sed, , awk, grep and open babel. The algorithm, could be something like this:</div><div><br></div><div>- find nat flag on pwscf input. ( can be done with grep)</div>
<div>- copy only the number (can be done using awk and defining = as delimiter )</div><div>- write this number in a new file with cat or sed.</div><div>- jump 1 line in the file (fixed format xyz issues)</div><div>- find the flag ATOMIC_POSITIONS and copy all lines until K_POINTS flag (can be done using sed)</div>
<div>- write it in your new xyz file.</div><div>- run open babel to convert the format.</div><div>Now the trick part might be the cell parameters since there are lot of different ways to define your cell. I would say this step can't be fully automated without tons of efforts to recognize and follow specific rules for each case (ibrav type. angles, etc). If you use only a single way to define your cells, use the same ideas as above and write a new line in your file with the cell size.</div>
<div><br></div><div>If you try to develop the script I can help you fixing the bugs/issues on it and in the end you will learn how to make a new script. :-)</div><div><br></div><div>Let me know if you need further assistance.</div>
<div><div><br></div>Regards,<div>Filipe</div></div></blockquote></div><br><br>-- <br><div dir="ltr">_________________________________________<br>Filipe Camargo Dalmatti Alves Lima<br>PhD Student<br>University of São Paulo, Physics Institute, Materials Physics Department, Nanomol Group, Brazil.<br>
Phones:    (11) 3091-6881  (USP)<br>                (11) 97408-2755 (Vivo)<br></div><br>