Vbscript Parse Comma Delimited String For Number Values Dynamically. Follow
I am trying to parse data within 1 string with values in this example. I have spent time reviewing Instr, Mid,and Split etc. functions in VBScript but, don't have a good idea of a combination that would do the following for me dynamically with the values changing in sizes.
Data from Text file in 1 string value => 9999-ROC013006-3.01,9999-ROC013006-3.02,9999-ROC013006-3.03.
I used the Mid function and concatenated the values to get results I am looking for 3.01,3.02,3.03. This only works when the string data is always in this format and the numbers in between the "-" and "," do not change in size. The example I have done only has 3 fields within the "," commas. The file could have 1 or over 20 fields so my method would not work.
Is there a way to code this so it seaches the string and picks out the values withing the second occurance of "-" and before ","?
Attached is the Bartender file and the Text file I am testing with.
Please let me know. I don't have much string manupulation coding experience with VB or VBScripting.
Thank you for your help.
Please sign in to leave a comment.