Hi all,
I'll try to be as clear as possible.
I've to download google trends data regarding a list of ticker name (ticker name is the identification name for a stock on the stock exchange).
I explore if STATA has some packages to do it, nevertheless it seems that it doesn't (if someone knows something, please let me know).

So, I found that with python you can do it. I found the codes on python and it seems that the input that you have to insert in one line of codes is the following:
Code:
KEYWORDS=['AAPL','FB','AMZN',]
Now, since I want to facilitate the process, my objective is to copy from STATA my ticker and then paste on python.
I Have a panel data as this one
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double fyear str8 tic
1987 "0015B"
1988 "0015B"
1989 "0015B"
1990 "0015B"
1991 "0015B"
1992 "0015B"
1993 "0015B"
1994 "0015B"
1995 "0015B"
1996 "0015B"
1997 "0015B"
1998 "0015B"
1999 "0015B"
2000 "0015B"
2001 "0015B"
2002 "0015B"
2003 "0015B"
2004 "0015B"
2005 "0015B"
2006 "0015B"
2007 "0015B"
2008 "0015B"
2009 "0015B"
2010 "0015B"
2011 "0015B"
2012 "0015B"
2013 "0015B"
2000 "0030B"
2001 "0030B"
2002 "0030B"
2003 "0030B"
2004 "0030B"
2005 "0030B"
2006 "0030B"
2007 "0030B"
2008 "0030B"
2009 "0030B"
2010 "0030B"
2011 "0030B"
2012 "0030B"
2013 "0030B"
1987 "0032A"
1988 "0032A"
1989 "0032A"
1990 "0032A"
1991 "0032A"
1992 "0032A"
1993 "0032A"
1994 "0032A"
1995 "0032A"
1996 "0032A"
1997 "0032A"
1998 "0032A"
1999 "0032A"
2000 "0032A"
2001 "0032A"
2002 "0032A"
2003 "0032A"
2004 "0032A"
2005 "0032A"
2006 "0032A"
2007 "0032A"
2008 "0032A"
2009 "0032A"
2010 "0032A"
2011 "0032A"
2012 "0032A"
2013 "0032A"
2014 "0032A"
2015 "0032A"
1987 "0033A"
1988 "0033A"
1989 "0033A"
1990 "0033A"
1991 "0033A"
1992 "0033A"
1993 "0033A"
1994 "0033A"
1995 "0033A"
1996 "0033A"
1997 "0033A"
1998 "0033A"
1999 "0033A"
2000 "0033A"
2001 "0033A"
2002 "0033A"
2003 "0033A"
2004 "0033A"
2005 "0033A"
2006 "0033A"
2007 "0033A"
2008 "0033A"
2009 "0033A"
2010 "0033A"
2011 "0033A"
2012 "0033A"
2013 "0033A"
2014 "0033A"
2015 "0033A"
2003 "0038A"
end
As you can see the ticker it repeats over the time.
I can overcome this problem with
Code:
duplicates drop tic fyear, force
Nevertheless, how can extract on a txt file the tic with the condition that Python needs, in other word with the 'tickername', (appendix and comma after the ticker name).

Thank you in advance for your kind support