Page 1 of 1

Writing a new text file from different series + text

Posted: Wed Feb 05, 2014 5:17 am
by shm83
Good afternoon. After trying many different ways, I failed to write a text file from a program.
The file should be as the one I attach, but letting the user to write in the first line whatever he/she wants.
The values would be taken from a series, and the numbers within the brackets are the index.
Thank you in advance :oops:

Re: Writing a new text file from different series + text

Posted: Wed Feb 05, 2014 9:19 am
by EViews Gareth
You're going to need to provide considerably more detail on what you're trying to do and what you've done so far.

Re: Writing a new text file from different series + text

Posted: Wed Feb 05, 2014 10:06 am
by shm83
This is what I have "achieved".
What I need is that instead of the name of the series above the values, a header like this appears:
k /1*30/;
NUMBER Temp(k);

Re: Writing a new text file from different series + text

Posted: Wed Feb 05, 2014 11:11 am
by EViews Gareth
It is actually really difficult to get attributes into the top of the series when export data at the moment. This works though:

Code: Select all

'%path = @runpath 'cd %path wfopen miwf.wf1 series aa for !a=1 to 30 aa(!a)=!a next alpha bb = @str(aa) alpha cc = @str(temp) frml trial2 = "Pre('"+ bb+"') = "+cc+";" series match = @trend+3 !numobs = @obsrange+2 pagecreate(page=temp) u !numobs series match = @trend+1 copy untitled\trial2 temp\trial2 @src match @dest match smpl 1 1 trial2 = "k /1*30/;" smpl 2 2 trial2 = "Number Temp(k)" smpl @all save(type=text) "temp1.txt" nonames @keep trial2

Re: Writing a new text file from different series + text

Posted: Thu Feb 06, 2014 2:03 am
by shm83
thanks a lot Gareth, I reckon I would not have reached to that part of the code in ages :(