tbs script problem
Hej. Jeg har dette script:Er der en der har lyst til at hjælpe??
Venlig hilsen
Set fso = CreateObject("Scripting.FileSystemObject")
Set re = New RegExp
re.Pattern = " +" 'matcher mere end ét mellemrum i række
isFound001 = false
lastLine = ""
lastDbl = 1.79769313486231E+308
Set inFile = fso.OpenTextFile("case2.txt")
Set outFile = fso.CreateTextFile("slut.txt", True)
Do Until inFile.AtEndOfStream
line = inFile.ReadLine
line = Replace(line, vbTab, " ") 'Erstat Tab med Space
line1white = re.Replace(line, " ") 'højest 1 mellemrum
lineArr = Split(line1white, " ")
If isFound001 And CDbl(Replace(lineArr(1),".",",")) > lastDbl Then
Exit Do
End If
Do 'null loop for at simulere Continue
'Første -0.100
If Not isFound001 And lineArr(1) = "-0.100" Then
curr = "-0.100"
lastDbl = CDbl(Replace(lineArr(1),".",","))
isFound001 = True
Exit Do 'Continue
End If
'Sidste linje i hver serie
If curr <> lineArr(1) And isFound001 Then
outFile.WriteLine lastLine
curr = lineArr(1)
lastDbl = CDbl(Replace(lineArr(1), ".", ","))
End If
Loop While False 'slut på null loop
lastLine = line
Loop
outFile.WriteLine lastLine 'Sidste linje udskrives
inFile.Close
outFile.Close
Den skal ikke kikke på decimal 2 og 3 kun tallet med en decimal.
Når tal i kollonne 2 er -.0.100 hvor 2 og 3 decimal ikke skal kikkes på, printes linien, indtil der kommer -0.200 uden igen at kikke på 2 og 3 decima
osv til slut fill
1.252 -0.099 25.3 0.00
1.253 -0.099 25.3 0.00
1.254 -0.099 25.3 0.00
1.255 -0.099 25.3 0.00
1.256 -0.099 25.3 0.00
1.257 -0.099 25.3 0.00
1.258 -0.099 25.5 0.00
1.259 -0.099 25.5 0.00
1.260 -0.100 25.5 0.00
1.261 -0.100 25.5 0.00
1.262 -0.100 25.5 0.00
1.263 -0.100 25.5 0.00
1.264 -0.100 25.5 0.00
1.265 -0.100 25.5 0.00
1.266 -0.100 25.5 0.00
1.267 -0.100 25.5 0.00
1.268 -0.100 25.5 0.00
1.269 -0.100 25.5 0.00
1.270 -0.100 25.7 0.00
1.271 -0.100 25.7 0.00
1.272 -0.101 25.7 0.00
1.273 -0.101 25.7 0.00
1.274 -0.101 25.7 0.00
1.275 -0.101 25.7 0.00
1.276 -0.101 25.7 0.00
1.277 -0.101 25.7 0.00
1.278 -0.101 25.7 0.00
1.279 -0.101 25.7 0.00
1.280 -0.101 25.9 0.00
1.281 -0.101 25.9 0.00
1.282 -0.101 25.9 0.00
1.283 -0.101 25.9 0.00
1.284 -0.101 25.9 0.00
1.285 -0.103 25.9 0.00
1.286 -0.103 25.9 0.00
1.287 -0.103 25.9 0.00
1.288 -0.103 25.9 0.00
1.289 -0.103 25.9 0.00
1.290 -0.103 26.0 0.00
1.291 -0.103 26.0 0.00
1.292 -0.103 26.0 0.00
1.293 -0.103 26.0 0.00
1.294 -0.103 26.0 0.00
1.295 -0.103 26.0 0.00
1.296 -0.103 26.0 0.00
1.297 -0.104 26.0 0.00
1.298 -0.104 26.0 0.00
1.299 -0.104 26.0 0.00
1.300 -0.104 26.0 0.00
1.301 -0.104 26.0 0.00
1.302 -0.104 26.2 0.00
1.303 -0.104 26.2 0.00
1.304 -0.104 26.2 0.00
1.305 -0.104 26.2 0.00
1.306 -0.104 26.2 0.00
1.307 -0.104 26.2 0.00
1.308 -0.104 26.2 0.00
1.309 -0.104 26.2 0.00
1.310 -0.105 26.2 0.00
1.311 -0.105 26.2 0.00
1.312 -0.105 26.2 0.00
1.313 -0.105 26.2 0.00
1.314 -0.105 26.4 0.00
1.315 -0.105 26.4 0.00
1.316 -0.105 26.4 0.00
1.317 -0.105 26.4 0.00
1.318 -0.105 26.4 0.00
1.319 -0.105 26.4 0.00
1.320 -0.105 26.4 0.00
1.321 -0.105 26.4 0.00
1.322 -0.105 26.4 0.00
1.323 -0.106 26.4 0.00
1.324 -0.106 26.4 0.00
1.325 -0.106 26.6 0.00
1.326 -0.106 26.6 0.00
1.327 -0.106 26.6 0.00
1.328 -0.106 26.6 0.00
1.329 -0.106 26.6 0.00
1.330 -0.106 26.6 0.00
1.331 -0.106 26.6 0.00
1.332 -0.106 26.6 0.00
1.333 -0.106 26.6 0.00
1.334 -0.106 26.6 0.00