How to extract sub-string from array [message #61699] |
Mon, 28 July 2008 01:07 |
Ian Dean
Messages: 26 Registered: January 2000
|
Junior Member |
|
|
Hi,
I've got an array such as ['Test_data;01', 'Test_data;005',
'New_dat;100','Old_dat'....]
What I'd like to do but haven;t achieved is create an array of the extension
past the ';'
i.e. ['01','005','100',''....]
I've tried this:
semi_colon = STREGEX(Data_array, ';')
; This gives an array of positions [9, 9, 7,-1...]
I can replace the -1s with string lengths easily enough giving [9, 9, 7,
7...]
However, I can't seem to extract the sub-strings
I tried
Extension = STRMID(Data_array, semi_colon + 1)
but this gives me a 2-d array and no clue which elements I require.
I suspect that there is some arcane use of histogram, but I am not brave
enough to try.
I know why the STRMID is failing, because the help says so, because both
arguments are arrays.
Looping though the list is not an option as in reality I have an array
length in the order of 500,000
Any help would be appreciated,
Regards,
Ian
|
|
|