I want to combine strings to create a path including the filename in one string, in order to use it in the use command.
For example:
--> however, the latter code line does not work.
Although this works to combine the strings:
it does not work with
as I do not have quoots around it, so it opens x.dta, not c:\data\stata\text.dta
The same problem arises when I want to create a text to use as an URL, such as
here I want to combine fixed text ("https://maps.googleapis.com/maps/api/distancematrix/json?origins=") with variable texts (the city names) in one string.
Thanks
Kees
For example:
Code:
scalar pathname = "c:\data\stata\" scalar filename = "test.dta" use pathname+filename
Although this works to combine the strings:
Code:
scalar x = pathname+filename
Code:
use x
The same problem arises when I want to create a text to use as an URL, such as
Code:
copy "https://maps.googleapis.com/maps/api/distancematrix/json?origins=Paris&destinations=Berlin" "test.txt", replace
Thanks
Kees
Comment