- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-6 11:28 ½s¿è
¦^´_ 1# lomchkimo
¸Õ¸Õ¬Ý- Option Explicit
- Sub EX()
- Dim S, xF As Object, i As Integer, ii As Integer, Ar, A, xA() As Variant
- S = Dir(ThisWorkbook.Path & "\log\*.CSV") ' **** קאּ¥¿½T¸ô®| ****
- A = Split("²£«~§å¸¹,¶}©l®É¶¡,µ²§ô®É¶¡,Robot ID,ARM,²£«~¸¹½X", ",") '°}¦C:·j´Mµ²ªGªº¼ÐÀY
- ReDim Preserve xA(0 To ii) '«·s«Å§i°}¦Cªº¤W¯Á¤ÞÈ
- 'Preserve (ÃöÁä¦r) «O¯d°}¦C즳¤¸¯ÀªºÈ
- xA(ii) = A
- ii = i + 1
- ReDim A(1 To 6)
- Do While S <> ""
- Set xF = GetObject(ThisWorkbook.Path & "\log\" & S)
- With ThisWorkbook.Sheets(1) '³oµ{¦¡½X©Ò¦b¬¡¶Ã¯ªº²Ä¤@Ó¤u§@ªí
- If InStr(xF.Sheets(1).[C5], .[C5]) = 1 Then 'Sheets(1)
- A(2) = xF.Sheets(1).[C2] '¶}©l®É¶¡
- A(3) = xF.Sheets(1).[C6] 'µ²§ô®É¶¡
- A(4) = Split(xF.Sheets(1).[C3], ":")(1) 'Robot ID °}¦C(1)ªºÈ: ¦r¦ê¤¤¥H":"¤À³Î
- A(5) = .[C5] 'ARM
- Ar = Split(S, ".00-") '°}¦C: ¦r¦ê¤¤¥H".00-"¤À³Î
- If UBound(Ar) = 1 Then
- A(1) = Ar(0) '²£«~§å¸¹
- S = Split(Split(Ar(1), "_")(0), "-")(1)
- 'Split(Ar(1), "_")(0) -> ¤À³Î«áªº¦r¦ê°}¦Cªº¯Á¤ÞÈ=0ªº¤¸¯ÀÈ
- If Mid(S, 1, 1) = "N" Then
- S = "Null"
- Else
- S = Mid(S, 2)
- End If
- A(6) = "'" & S '²£«~¸¹½X
- ReDim Preserve xA(0 To ii)
- xA(ii) = A
- ii = ii + 1
- ElseIf UBound(Ar) = 2 Then 'E1Q882.00-E1Q901.00-J07-K01_d3-h3-t18.csv
- For i = 0 To 1
- A(1) = Ar(i) '²£«~§å¸¹
- S = Split(Split(Ar(2), "_")(0), "-")(i)
- If Mid(S, 1, 1) = "N" Then
- S = "Null"
- Else
- S = Mid(S, 2)
- End If
- A(6) = "'" & S '²£«~¸¹½X
- ReDim Preserve xA(0 To ii)
- xA(ii) = A
- ii = ii + 1
- Next
- End If
- End If
- End With
- xF.Close
- S = Dir
- Loop
- With Sheets.Add(, Sheets(1))
- '.Name = "·j´Mµ²ªG"
- .[a1].Resize(ii, 6) = Application.Transpose(Application.Transpose(xA))
- End With
- End Sub
½Æ»s¥N½X |
|