Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I'm trying to extract the value in a string beyond a specific point in the script.
In a field named 'Project' I have different values and I want to extract the value after the '#' in the data, the # moves in the statement dependant on a prefix so can be in position 4 or position 5 as in the example below
92;#35/05099
or
675;#35/08627
I want them to return 35/05099 & 35/08627 respectively.
MID() seems to be part of the answer but requires a fixed 'start point' like
mid(Project,5,12)
Provides 35/05099 but #35/08627 for the second argument - how can I 'see' the # and count from there?
Cheers!
if field name is myField:
mid(myfield, index(myfield,'#'))
iHope it helps
Try subfield(Project,'#',2)
Hi
Try like this
Load SubField('675;#35/08627','#',2) As Test AutoGenerate 1;
or
Load SubField(FieldName,'#',2) As FieldName;
Hope it helps
Hi Jeff,
Let see
SubField('92;#35/05099','#',2) Return 35/05099
SubField('675;#35/08627 ','#',2) Return 35/08627
So you can try SubField function to do your job.
Regards,
Sokkorn
All of the above worked - but the one that worked the best for my particular worksheet was subfield(Project,'#',2) by Gysbert Wassenaar
A big thank you to all the responders.
Jeff.