I have some code with a simplified example below. I want to run a Windows shell command through a bunch of files. The problem seems to be that the backwards slash interacting with the local macro. I read this article by Nick Cox, http://www.stata-journal.com/sjpdf.h...iclenum=pr0042 and it detailed that Stata smartly deals with the problem. However since I'm exporting the command to shell that doesn't work here.
I know of 2 solutions to this problem but wanted to know if there was a different solution that did not require extra macros or moving stuff.
PROBLEM:
SOLUTION 1:
SOLUTION 2:
I can just do the command in my current folder and then move all the files with Stata's copy command.
Thanks
I know of 2 solutions to this problem but wanted to know if there was a different solution that did not require extra macros or moving stuff.
PROBLEM:
Code:
foreach i in a{
forval k=2/2{
shell pdftohtml.exe pdfs\`i'_`k'.pdf htmls\`i'_`k'.html
}
}
Code:
foreach i in a{
forval k=2/2{
local x= "htmls\"
local z="pdfs\"
shell pdftohtml.exe "`z'\"`i'_`k'.pdf "`x'\"`i'_`k'.html
}
}
I can just do the command in my current folder and then move all the files with Stata's copy command.
Thanks

Comment