Page 1 of 1

Create a comma separated string with quotes?

Posted: Sun Aug 12, 2018 11:10 am
by xprimexinverse
Hi everyone,

I would like to use the import command in an automated way and to do this I need to pass in the string values for the column head names as options.

For example, below I pass three strings into the colheadnames option of the import command.

Code: Select all

colheadnames=("Name","Unit_code","Unit_description")
However, the above example is hard coded and I don't want to do this. What I'd like to do is pass all of these individual strings in as a single string variable (or single argument).

For example, I'd like to be able to do this:

Code: Select all

%colheadnames = "Name","Unit_code","Unit_description" colheadnames = (%colheadnames)
Any ideas?

Thanks,
Graeme

Re: Create a comma separated string with quotes?

Posted: Sun Aug 12, 2018 11:12 am
by EViews Gareth

Code: Select all

%colheadnames = """Name"",""Unit_code"",""Unit_description"""

Re: Create a comma separated string with quotes?

Posted: Sun Aug 12, 2018 1:14 pm
by xprimexinverse
Thanks very much, Gareth! :D

Works a charm!