犯了個失誤,在excel中下拉數據時不小心端口號自增了。大概上萬條數據,寫了個正則表達式,完美解決問題。
curl -X GET http://10.0.0.150:8090/xxx?param=3000001;
curl -X GET http://10.0.0.150:8090/xxx?param=3000001;
curl -X GET http://10.0.0.150:8091/xxx?param=3000001;
Private Sub RegExp_Replace()
Dim RegExp As Object
Dim SearchRange As Range, Cell As Range
'此處定義正則表達式
Set RegExp = CreateObject("vbscript.regexp")
RegExp.Pattern = "150:.*/"
'此處指定查找范圍
Set SearchRange = ActiveSheet.Range("A1:A5000")
'遍歷查找范圍內的單元格
For Each Cell In SearchRange
Set Matches = RegExp.Execute(Cell.Value)
If Matches.Count >= 1 Then
Set Match = Matches(0)
Cell.Value = RegExp.Replace(Cell.Value, "150:8090/")
End If
Next
End Sub