I could use some help on importing a somewhat complex CSV file. The file is structured as follows:
The complication is that the entire file is pretty big, but I only need parts of it. For instance, I'm only interested in the first two observations (2004Q2+Q3), and I would like to filter such that I only get FFTGTAVG and discard, say, UST 10Y.INDX_NM INDX_DESC SCE_NM PERIOD VALUE
UST 3M US Treasury Bill (3M) TDA_U1 6/1/2004 1.088
UST 3M US Treasury Bill (3M) TDA_U1 9/1/2004 1.5037
UST 3M US Treasury Bill (3M) TDA_U1 12/1/2004 2.0338
UST 3M US Treasury Bill (3M) TDA_U1 3/1/2005 2.5748
UST 10Y US Treasury Note (10Y) TDA_U1 6/1/2004 4.5864
UST 10Y US Treasury Note (10Y) TDA_U1 9/1/2004 4.3082
UST 10Y US Treasury Note (10Y) TDA_U1 12/1/2004 4.1742
UST 10Y US Treasury Note (10Y) TDA_U1 3/1/2005 4.2996
FFTGTAVG Average Target Federal TDA_U1 6/1/2004 1
FFTGTAVG Average Target Federal TDA_U1 9/1/2004 1.413
FFTGTAVG Average Target Federal TDA_U1 12/1/2004 1.9348
FFTGTAVG Average Target Federal TDA_U1 3/1/2005 2.4333
UST 3M US Treasury Bill (3M) TDA_U2 6/1/2004 1.088
UST 3M US Treasury Bill (3M) TDA_U2 9/1/2004 1.5037
UST 3M US Treasury Bill (3M) TDA_U2 12/1/2004 2.0338
UST 3M US Treasury Bill (3M) TDA_U2 3/1/2005 2.5748
UST 10Y US Treasury Note (10Y) TDA_U2 6/1/2004 4.5864
UST 10Y US Treasury Note (10Y) TDA_U2 9/1/2004 4.3082
UST 10Y US Treasury Note (10Y) TDA_U2 12/1/2004 4.1742
UST 10Y US Treasury Note (10Y) TDA_U2 3/1/2005 4.2996
FFTGTAVG Average Target Federal TDA_U2 6/1/2004 1
FFTGTAVG Average Target Federal TDA_U2 9/1/2004 1.413
FFTGTAVG Average Target Federal TDA_U2 12/1/2004 1.9348
FFTGTAVG Average Target Federal TDA_U2 3/1/2005 2.4333
I've been experimenting with the import file, but I have to say that I haven't been terribly successful. For instance, if my file has a date range of, say, 2004Q2-2004Q3, then the command
import %file @freq q 2004q2
reads in data for the first variable (UST 3M), not for all of them. Also, in an ideal world, I could directly use some of the information in the table to name the variables, such as use sce_nm as part of the variable name ("var_{%sce_nm}").
Any help would be appreciated,
Philipp
