Hi,
I used a code to save some string lists as text files, and now I'm trying to convert those text files as new string lists in another code. The only way I found is to create a blank string list and manually use the option "insert text file" as seen on the capture I also posted. When I check on the capture window, it doesn't seem to have registered a command. is such command exist?
thanks in advance
inserting text files in string
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
inserting text files in string
- Attachments
-
- Capture.PNG (17.5 KiB) Viewed 5976 times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inserting text files in string
You'd have to go through a text object. text.append to open the text file.
Follow us on Twitter @IHSEViews
Re: inserting text files in string
This create a new text object, but I need to convert those to string lists. Is it possible?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inserting text files in string
It's just a string object. Sorry about that.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inserting text files in string
There isn't an easy way to do it. String objects aren't really intended for that sort of thing (I'm kinda surprised the menu item exists!).
If the text file only has one line, you would go through a text object, then grab the first line into a string. Or convert the text object into an svector and loop through or something.
If the text file only has one line, you would go through a text object, then grab the first line into a string. Or convert the text object into an svector and loop through or something.
Follow us on Twitter @IHSEViews
Re: inserting text files in string
Ok I understand. Since I saved those files from string objects that I created, is there a better way to save them for other use than saving them as text?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inserting text files in string
No.
Given that there isn't a proc to save strings as text, how did you save them?
Given that there isn't a proc to save strings as text, how did you save them?
Follow us on Twitter @IHSEViews
Re: inserting text files in string
I used this code:
%BD = "EMERGE G10 EMERGECW EMERGELA EMERGEMA EMERGEPR"
for %B {%BD}
%path = "\\lacaisse.com\gdd\ACD\PR\HAVER\DATA\"+%B+".dat"
string list_{%B} = @wquery(%PATH, "name matches *", "name")
string list_{%B}_M = @wquery(%path, "freq=m", "name")
string list_{%B}_Q = @wquery(%path, "freq=q", "name")
string list_{%B}_A = @wquery(%path, "freq=a", "name")
FREEZE(flist_{%B}) list_{%B}
FREEZE(flist_{%B}_M) list_{%B}_M
FREEZE(flist_{%B}_Q) list_{%B}_Q
FREEZE(flist_{%B}_A) list_{%B}_A
%page = "M Q A"
%save = "h:\ra\gestion dynamique des devises\données\analyse comparative\emerging\donnees\tables\"+ %B + ".txt"
FLIST_{%B}.save {%SAVE}
for %p {%page}
%save_p = "h:\ra\gestion dynamique des devises\données\analyse comparative\emerging\donnees\tables\"+ %B + "_"+ %p +".txt"
flist_{%B}_{%P}.save {%save_p}
next
next
FREEZE(flist_{%B}_A) list_{%B}_A
FLIST_{%B}.save {%SAVE}
But I actually found a way to get around the problem, I juste saved the wf and opened it in my other program.
Thank you for your help.
%BD = "EMERGE G10 EMERGECW EMERGELA EMERGEMA EMERGEPR"
for %B {%BD}
%path = "\\lacaisse.com\gdd\ACD\PR\HAVER\DATA\"+%B+".dat"
string list_{%B} = @wquery(%PATH, "name matches *", "name")
string list_{%B}_M = @wquery(%path, "freq=m", "name")
string list_{%B}_Q = @wquery(%path, "freq=q", "name")
string list_{%B}_A = @wquery(%path, "freq=a", "name")
FREEZE(flist_{%B}) list_{%B}
FREEZE(flist_{%B}_M) list_{%B}_M
FREEZE(flist_{%B}_Q) list_{%B}_Q
FREEZE(flist_{%B}_A) list_{%B}_A
%page = "M Q A"
%save = "h:\ra\gestion dynamique des devises\données\analyse comparative\emerging\donnees\tables\"+ %B + ".txt"
FLIST_{%B}.save {%SAVE}
for %p {%page}
%save_p = "h:\ra\gestion dynamique des devises\données\analyse comparative\emerging\donnees\tables\"+ %B + "_"+ %p +".txt"
flist_{%B}_{%P}.save {%save_p}
next
next
FREEZE(flist_{%B}_A) list_{%B}_A
FLIST_{%B}.save {%SAVE}
But I actually found a way to get around the problem, I juste saved the wf and opened it in my other program.
Thank you for your help.
Who is online
Users browsing this forum: No registered users and 10 guests