Hi
I have an alpha series (6 million or so) that I've been trying to split from one series into two where the size of the string varies making @trim difficult
For example, I'm attempting to split the string into two - generate two additional series - one containing all characters up to the space preceding "["
the second containing the string with the []
the number of characters in the strings vary across the dataset
here's a example of a typical string:
Accounting, tax preparation, bookkeeping and payroll services [BS541200]
thanks
extract a portion of a string
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 562
- Joined: Thu Apr 25, 2013 7:48 pm
Re: extract a portion of a string
Hello,
As a starting point, here's an example of creating new alpha series (left and right) by splitting an existing alpha series (orig) on a specific character ("[").
As a starting point, here's an example of creating new alpha series (left and right) by splitting an existing alpha series (orig) on a specific character ("[").
Code: Select all
alpha left = @left(orig, @instr(orig, "[") - 1)
alpha right = @mid(orig, @instr(orig, "["))
-
- Posts: 10
- Joined: Tue Jul 16, 2019 10:37 am
Re: extract a portion of a string
big help - thanks
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 13 guests