robinsdale
Programmer
Hi all,
Another mild moment of frustration - perhaps you can help. I'm writing a UDF that extracts data from a text file. The text file data is always in the same format, right down to how many spaces within specific data it lies.
Suchly:
LName: Flintstone, Fred
In VFP, I would open the file using FOpen() - VBA provides a similar function - Open(). I would then step through the file line by line, and process each line based on the data string. One very powerful tool seems to be lacking, something analgous to SUBSTR(), for which the syntax is:
SUBSTR ( string_to_extract_from, start_point, end_point )
An example of that function is:
cLine = "LName: Flintstone, Fred"
cLine = SUBSTR ( cLine, 8 ,10 )
* ...yields 'Flintstone'
Know of anything like it for VBA? Anything been cobbled that would work similarly? I've been fiddling with Left() and Right() and InStr() but can't find anything like the FoxPro AT() or RAT() functions, either, to recreate a SUBSTR() type function.
Thanks in advance...
Regards,
Robin
Another mild moment of frustration - perhaps you can help. I'm writing a UDF that extracts data from a text file. The text file data is always in the same format, right down to how many spaces within specific data it lies.
Suchly:
LName: Flintstone, Fred
In VFP, I would open the file using FOpen() - VBA provides a similar function - Open(). I would then step through the file line by line, and process each line based on the data string. One very powerful tool seems to be lacking, something analgous to SUBSTR(), for which the syntax is:
SUBSTR ( string_to_extract_from, start_point, end_point )
An example of that function is:
cLine = "LName: Flintstone, Fred"
cLine = SUBSTR ( cLine, 8 ,10 )
* ...yields 'Flintstone'
Know of anything like it for VBA? Anything been cobbled that would work similarly? I've been fiddling with Left() and Right() and InStr() but can't find anything like the FoxPro AT() or RAT() functions, either, to recreate a SUBSTR() type function.
Thanks in advance...
Regards,
Robin