开发者

VBScript Help: Split? Replace?

Im working on a vbscript that is pulling data from excel to text. I currently have a column in an excel sheet with values 开发者_如何转开发like:

305 ABCDE 23 FTPXX N3 TOY 3321 APPLE

I want to get the 2nd values to only show so that the data would look like

ABCDE FTPXX TOY APPLE

I was thinking of trying to split the values and then replacing the first part of the value as "spaces" and just trimming the results.

Can someone help me with this or know a better way to do this?

Thanks in advance.


s1 = "305 ABCDE 23 FTPXX N3 TOY 3321 APPLE"
s2 = Split(s1, " ")
For i = 0 To UBound(s2) Step 2
    s2(i) = " "
Next
s3 = trim(Join(s2, ""))
WScript.Echo s3


set myregexp = new RegExp
myregexp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "([a-zA-Z]+)"
Set myMatches = myRegExp.Execute(subjectString)

myMatches will hold any matches found within subjectString

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜