Hi,
I've a set of GPH files that I would like to convert to the PostScript and subsequently, PNG format (on the lines of issues discussed here). I drafted a simple code to read a set of *.gph files via the fs (ssc) module. When I attempt to run the code below, Stata returns an error: unexpected end of file.
This is what happens when I attempt to run the lines:
I've a set of GPH files that I would like to convert to the PostScript and subsequently, PNG format (on the lines of issues discussed here). I drafted a simple code to read a set of *.gph files via the fs (ssc) module. When I attempt to run the code below, Stata returns an error: unexpected end of file.
Code:
/* == Convert Files to PS from GPH == */ // Set the file directory local graphdir "C:\where I keep my GPH files" cd `graphdir' // Postscript settings graph set ps pagesize custom graph set ps pagewidth 11 graph set ps pageheight 8 graph set ps tmargin 0 graph set ps lmargin 0 graph set ps logo off graph set ps fontface Helvetica // List files fs *.gph // Export to PS foreach gf in `r(files)' { graph use "`gf'" graph export "`gf'.ps", replace #delimit ; shell "C:\gs9.15\bin\gswin64c.exe" -dSAFER -dBATCH -dNOPAUSE -r100 -g1100x800 -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile="`gf'" "`gf'.ps"; }
Code:
. // Export to PS
. foreach gf in `r(files)' {
2. graph use "`gf'"
3. graph export "`gf'.ps", replace
4. #delimit ;
delimiter now ;
. shell "C:\gs9.15\bin\gswin64c.exe"
> -dSAFER -dBATCH -dNOPAUSE
> -r100 -g1100x800 -sDEVICE=png16m
> -dGraphicsAlphaBits=4 -dTextAlphaBits=4
> -sOutputFile="`gf'" "`gf'.ps";
5. }
unexpected end of file
Comment