Hi,
I am trying to export image files (in .png format) after removing notes and title from existing graph (.gph) files in Stata. Using gr_edit commands below I can do this for individual .gph files:
graph use "$dir1/This is graph one.gph"
gr_edit .note.text = {}
gr_edit .title.text = {}
graph export "$dir1/This is graph one - no title.png", replace
I need to do this for multiple .gph files in multiple folders. Is it possible to use a foreach loop over the list of .gph files in each folder to create .png files as opposed to manually doing it for each file separately as above?
Although there are hundreds of .gph files in over 10 directories, consider below as the list of existing files:
$dir1/This is graph one.gph
$dir1/Graph two.gph
$dir2/I am graph three.gph
$dir3/This is graph four.gph
I need to export these image files:
$dir1/This is graph one - no title.png
$dir1/Graph two - no title.png
$dir2/I am graph three - no title.png
$dir3/This is graph four - no title.png
Any help is appreciated.
I am trying to export image files (in .png format) after removing notes and title from existing graph (.gph) files in Stata. Using gr_edit commands below I can do this for individual .gph files:
graph use "$dir1/This is graph one.gph"
gr_edit .note.text = {}
gr_edit .title.text = {}
graph export "$dir1/This is graph one - no title.png", replace
I need to do this for multiple .gph files in multiple folders. Is it possible to use a foreach loop over the list of .gph files in each folder to create .png files as opposed to manually doing it for each file separately as above?
Although there are hundreds of .gph files in over 10 directories, consider below as the list of existing files:
$dir1/This is graph one.gph
$dir1/Graph two.gph
$dir2/I am graph three.gph
$dir3/This is graph four.gph
I need to export these image files:
$dir1/This is graph one - no title.png
$dir1/Graph two - no title.png
$dir2/I am graph three - no title.png
$dir3/This is graph four - no title.png
Any help is appreciated.
Comment