Page 1 of 1
Importing and analyzing multiple files (version 6)
Posted: Sun Sep 11, 2011 11:49 am
by met
Hi,
I have many txt files each containing intra-day data of a specific stock on a specific day! For example AAPL040611 contains all quotes, prices, spreads, etc for Apple on the April, 6th 2011.
I want eViews to automatically import the files and organize them so that i can for example calculate the mean spread over the whole period.
Unfortunately I have no experience with eViews nor programming but need to have the investigation done as soon as possible.
I guess a for loop would do it? Can anyone help me with the commands?
I changed the working directory to the folder containing the files and opened a list with the filenames but then I got stuck...
I use version 6.
Thanks for helping!
Importing and analyzing multiple files (version 6)
Posted: Sun Sep 11, 2011 12:13 pm
by EViews Gareth
This would be much easier in EViews 7. But in 6 the best thing to do is to use pageload to bring in the files on at a time, and then copy to bring them into the same page.
Re: Importing and analyzing multiple files (version 6)
Posted: Mon Sep 12, 2011 1:20 am
by met
Where do I start? Can you help me with the commands? Sorry I'm desperate...
Re: Importing and analyzing multiple files (version 6)
Posted: Mon Sep 12, 2011 8:04 am
by EViews Gareth
The commands are pageload and copy. Both are documented in the Command Reference.
Re: Importing and analyzing multiple files (version 6)
Posted: Mon Sep 12, 2011 10:58 am
by met
Thanks so far Gareth! I make some slow progress...but still I don't manage to implement a for loop, importing my files, picking series having the same name and bringing those together in one page. (for example picking from every file the series called "price" and dropping it to a specific page in the workfile).
Another very basic problem i encountered is to split my file by date. Remember that I have several thousand observation for each day (10 in total). I thought it should be quite easy with the sample function, however, the sample doesn't not contain any observation. What do I do wrong?
Thanks so much!
Re: Importing and analyzing multiple files (version 6)
Posted: Mon Sep 12, 2011 11:04 am
by EViews Gareth
What do I do wrong?
Hard to know, without knowing what you've done.
Re: Importing and analyzing multiple files (version 6)
Posted: Tue Sep 13, 2011 7:22 am
by met
Yeah that's true! Fortunately I've solved the sampling problem, and it works fine now! For the loop I tried to do the same as in
http://forums.eviews.com/viewtopic.php? ... lly#p16198! However, as it seems version 6 does not support "@wdir" and "@word"? I guess that "@wdir" can be replaced somehow by"shell(out=flist) dir /b" but I haven't found anything on "@word". I'm freaking out on this simple command:
Code: Select all
open the first file
%file = @word(%filenames,1)
It seems that I'm not talented at all in this stuff! I hope you can help me a bit with my aforementionned problems to get my project going...
Thanks,
Re: Importing and analyzing multiple files (version 6)
Posted: Tue Sep 13, 2011 7:40 am
by EViews Gareth
As you point out, @word isn't available in EV6. Nor is there an easy replacement.