ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

Excel 2010 Âà¸mtxtÀɨD§U

¦^´_ 7# kulisung
  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")
  4. Set d2 = CreateObject("Scripting.Dictionary")
  5. fs = ThisWorkbook.Path & "\test.log" '¤å¦rÀɥؿý
  6. Open fs For Input As #1
  7. Do While Not EOF(1)
  8.    Line Input #1, mystr
  9.    If InStr(mystr, "- ") > 0 Then  
  10.    ElseIf InStr(mystr, "Time:") > 0 Then
  11.    no = Trim(Replace(mystr, "Time:", ""))
  12.    d(no) = ""
  13.    ElseIf InStr(mystr, ":") > 0 Then
  14.    n = Split(mystr, ":")(0)
  15.      d2(n) = ""
  16.      d1(no & Chr(10) & n) = IIf(d1(no & Chr(10) & n) = "", Trim(Replace(mystr, n & ":", "")), d1(no & Chr(10) & n) & Chr(10) & Trim(Replace(mystr, n & ":", "")))
  17.    Else
  18.      d1(no & Chr(10) & n) = d1(no & Chr(10) & n) & Chr(10) & mystr
  19.    End If
  20. Loop
  21. Close #1
  22. [A1] = "Time"
  23. [B1].Resize(, d2.Count) = d2.keys
  24. r = 1
  25. For Each ky In d.keys
  26. r = r + 1
  27. Cells(r, 1) = ky
  28.    For k = 1 To d2.Count
  29.       Cells(r, k + 1) = d1(ky & Chr(10) & Cells(1, k + 1))
  30.    Next
  31. Next
  32. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


¤£¦n·N«ä¡A¸Õ¹Lµ{¦¡Âà¥X¨Ó¦ü¥G·|³y¦¨¿ù¦ì¥H¤Î«á­±³¡¥÷¸ê®Æ¿ò¥¢¡]¨Ì¤W­±ªº3µ§¸ê®Æ¨Ó´ú¸Õ¡^
µ²ªG¦p¤U¹Ï¡A¦A¦¸³Â·Ð¯u¬O¤£¦n·N«ä
«e¥b³¡¥÷

«á¥b³¡¥÷

TOP

¦^´_ 5# kulisung
  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")
  4. Set d2 = CreateObject("Scripting.Dictionary")

  5. fs = ThisWorkbook.Path & "\test.log" '¤å¦rÀɥؿý
  6. Open fs For Input As #1
  7. Do While Not EOF(1)
  8.    Line Input #1, mystr
  9.    If InStr(mystr, "Time:") > 0 Then
  10.    no = Trim(Replace(mystr, "Time:", ""))
  11.    d(no) = ""
  12.    ElseIf InStr(mystr, ":") > 0 Then
  13.    n = Split(mystr, ":")(0)
  14.      d2(n) = ""
  15.      d1(no & Chr(10) & n) = Trim(Replace(mystr, n & ":", ""))
  16.      Else
  17.      d1(no & Chr(10) & n) = d1(no & Chr(10) & n) & Chr(10) & mystr
  18.    End If
  19. Loop
  20. Close #1
  21. [A1] = "Time"
  22. [B1].Resize(, d2.Count) = d2.keys
  23. r = 1
  24. For Each ky In d.keys
  25. r = r + 1
  26. Cells(r, 1) = ky
  27.    For k = 1 To d2.Count
  28.       Cells(r, k + 1) = d1(ky & Chr(10) & Cells(1, k))
  29.    Next
  30. Next
  31. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh

·PÁ¶W¯Åª©¥D Hsieh ªº¦^ÂÐ
¤£¹L¤j·§¬O¦]¬°§Ú¥u¬OÂ^¨ú¤@¬qlog¤º®eªºÃö«Y¡A¦]¬°µo²{Âà¥Xªº¤º®e¦ü¥G¦³¿ù
¸g¹L¬d¬Ý¦ü¥G¬O¦]¬°¬O¥Î"-"¨Ó°Ï¤À¡A©Ò¥H³y¦¨³o¼Ëªº¿ù»~
¦]¬°¬Ý¹L¤j¶qªºlog¤º®eµo²{¤£¦Pªº¤é´Á·|¦³¬Û¦Pªº-----xx----- ¬ö¿ý
¨Ò¦p
  -------------- 01 --------------
Time: 2013.06.25, 00:01:10
.
-------------- 01 --------------
Time: 2013.06.26, 10:01:20      
.
.
¬Ý°_¨Ó®É¶¡¤~ºâ¬O°ß¤@­È


¥H¤U¬O¹ê»Úªºlog¤º®e
-------------- 19 --------------
Time: 2013.06.25, 00:44:13
Connect : OK!
   Model: C1200
   Version: 1.0.0-9
   Mac: 00:FF:AA:BB:CC:01
Video :
   Jpeg Connection...Ok
   Image Check : Ok
Audio In :
   Connection...Ok
   PC Listening Check : Ok
Wlan :
   Enable Wlan...Ok
   Set ESSID...Ok
   Try connect Camera...Ok
CountryCode :
   Write Code...Ok!
LightSensor :
   Test Sensor...Ok
Reset Button :
   Setting Test mode...Ok!
   Test Button...Ok
WPS Button :
   Setting Test mode...Ok!
   Test Button...Ok
Link QRCode :
   Input : 11100000001A0123456
   Write Mac...Ok
   Check Mac...Ok! New Mac: 00:FF:AA:BB:CC:0F
Cloud Version :
   Getting...Version: 1.1
Fast Factory Reset :
   Reset Camera...Ok!
   Model: C1200
   Version: 1.0.0-9
   Mac: 00:FF:AA:BB:CC:0F
   Country Code: 0
-------------- 20 --------------
Time: 2013.06.25, 00:46:26
Connect : OK!
   Model: C1200
   Version: 1.0.0-9
   Mac: 00:FF:AA:BB:CC:02
Video :
   Jpeg Connection...Ok
   Image Check : Ok
Audio In :
   Connection...Ok
   PC Listening Check : User Stop!
-------------- 19 --------------
Time: 2013.06.25, 06:07:22
Connect : OK!
   Model: C1200
   Version: 1.0.0-9
   Mac: 00:FF:AA:BB:CC:03
Video :
   Jpeg Connection...Ok
   Image Check : Ok
Audio In :
   Connection...Ok
   PC Listening Check : Ok
Wlan :
   Enable Wlan...Ok
   Set ESSID...Ok
   Try connect Camera...Ok
CountryCode :
   Write Code...Ok!
LightSensor :
   Test Sensor...Ok
Reset Button :
   Setting Test mode...Ok!
   Test Button...Ok
WPS Button :
   Setting Test mode...Ok!
   Test Button...Ok
Link QRCode :
   Input : 11100000001A923415
   Write Mac...Ok
   Check Mac...Ok! New Mac: 00:FF:AA:BB:CC:1A
Cloud Version :
   Getting...Version: 1.1
Fast Factory Reset :
   Reset Camera...Ok!
   Model: C1200
   Version: 1.0.0-9
   Mac: 00:FF:AA:BB:CC:1A
   Country Code: 0

³o¼Ëªº§PÂ_±ø¥ó¬O§_¤S½ÆÂø¤F¨Ç©O¡H ÁٽжW¯Åª©¥D¨ó§U ·P®¦

TOP

¦^´_ 3# kulisung
  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")
  4. Set d2 = CreateObject("Scripting.Dictionary")

  5. fs = ThisWorkbook.Path & "\test.log" '¤å¦rÀɥؿý
  6. Open fs For Input As #1
  7. Do While Not EOF(1)
  8.    Line Input #1, mystr
  9.    If InStr(mystr, "-- ") > 0 Then
  10.    no = Trim(Replace(mystr, "-", ""))
  11.    d(no) = ""
  12.    ElseIf InStr(mystr, ":") > 0 Then
  13.    n = Split(mystr, ":")(0)
  14.      d2(n) = ""
  15.      d1(no & Chr(10) & n) = Trim(Replace(mystr, n & ":", ""))
  16.      Else
  17.      d1(no & Chr(10) & n) = d1(no & Chr(10) & n) & Chr(10) & mystr
  18.    End If
  19. Loop
  20. Close #1
  21. [A1].Resize(, d2.Count) = d2.keys
  22. r = 1
  23. For Each ky In d.keys
  24. r = r + 1
  25.    For k = 1 To d2.Count
  26.       Cells(r, k) = d1(ky & Chr(10) & Cells(1, k))
  27.    Next
  28. Next
  29. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# luhpro


    Hi~luhpro¤j¤j¡ã·PÁ§Aªº¦^ÂÐ
¦]¬°¤p§Ì¨Ã¤£¬O«ÜÀ´VBAªº»yªk¡A¥u¬OÅÞ¿è·§©ÀÁÙ¥i¥H
¦Ü©ó¨ºd(lpos)ªº¥Îªk¡A¤p§Ì¦³µy·L©Bª¯¤@¤UDictionaryªº²[¸q
¦ý¤´¬O¤£¬ÆÁA¸Ñ¡]¦]¤p§ÌµLcodingªº¸gÅç¡A©Ò¥H¤@¨Ç²`¤Jªº·§©À­nÁA¸Ñ¦³ÂI¤pÃø¡^
¸Õ¹L¤j¤jªºµ{¦¡¤]¬O¦bd(lpos)³o¦æ¥X²{°ÝÃD¨S¦³©w¸qªº°ÝÃD
½Ð°Ýd(lpos)¬O§_»Ý­n¥t¥~©w¸q¡H

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2013-6-30 22:28 ½s¿è

¦^´_ 1# kulisung
Ãö©óŪÀɪºµ{¦¡³o¸Ì´N¤£ÂØ­z¤F,
¶È´£¨Ñ¦Û¤v·Qªº¸ê®Æ¦s©ñ¦ì¸m³B²z¤è¦¡: (d(lpos) ¬O§Q¥Î Dictionary ¨Ó¯Á¤Þ¸Ó¸ê®Æ¦s©ñªºÄæ¦ì)

ŪÀÉ...
lrow = 2 ' ¦C 1 ¬°¼ÐÃD¦C
icol = 1 ' ¸ê®Æ±q²Ä 1 Äæ¶}©l©ñ, °²³]¨Cµ§¸ê®Æ Title ¤å¦r³£¬Û¦P
sStr = Ū¨úªº¤@µ§¸ê®Æ¤º®e

Do While EOF(1)
  Do While Left(sStr, 5) <> "-----"
   lpos = InStr(1, sStr, ":")
    stitle = Trim(Left(sStr, lpos - 2))
    If d(lpos) = "" Then
      Cells(1, icol) = stitle
      icol = icol + 1
    End If
    sData = Trim(Mid(sStr, lpos + 2, Len(sStr) - lpos))
    sStr = Ū¨úªº¤@µ§¸ê®Æ¤º®e
  Loop
  lrow = lrow + 1
Loop

' ÃöÀÉ

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦pÆp¥Û¡j®É¶¡¹ï¤@­Ó¦³´¼¼zªº¤H¦Ó¨¥¡A´N¦pÆp¥Û¯ë¬Ã¶Q¡F¦ý¹ï·M¤H¨Ó»¡¡A«o¹³¬O¤@§âªd¤g¡A¤@ÂI»ù­È¤]¨S¦³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD