Hi!
I have interwoven two strings using the winterleave command. However, there is a space between the components of each interwoven pairing. I have tried the ltrim and rtrim to remove these spaces, but it didn't work. Also, I have checked the original strings to look for extra spaces and I could not find any. Is there another way to remove them?
I have attached the workfile, and the code for your reference.
The I would like to remove the spaces in the middle of each paired object from the string custids (i.e. CALCASIEU 4095 cIND098 3275 --> CALCASIEU4095 cIND0983275)
Thanks!
Bob
wfcreate GPCM_Dem_Loader m 1950 2050
pagecreate(page=meta_data) u 1 1000
import(t=excel) C:\warem32\demand_loader_db.xlsx range="sector_cust_loc" @freq u 1
string locids = ""
string custcode = ""
!y = @obs(cust_loc_id01)
for !z = 1 to !y
%sample = @str(!z)
smpl %sample %sample
!val = @elem(cust_loc_id01,%sample)
%val = @str(!val)
string locids = locids + %val +" "
%val = @elem(cust_code,%sample)
string custcode = custcode + %val +" "
next
string CUSTIDS = @winterleave(custcode,locids)
removing spaces from string created using @winterleave
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
removing spaces from string created using @winterleave
- Attachments
-
- demand_loader_db.xlsx
- (424.32 KiB) Downloaded 231 times
-
- gpcm_dem_loader.wf1
- (161.82 KiB) Downloaded 210 times
Re: removing spaces from string created using @winterleave
I managed to figure this out by creating the string custids before the loop, and adding the values of each component string to it during the loop, with a space after the second component.
Thanks!
Thanks!
Who is online
Users browsing this forum: No registered users and 25 guests