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

Excel 2010 Âà¸mtxtÀɨD§U

Excel 2010 Âà¸mtxtÀɨD§U

¦U¦ì¤j¤j¦w¡A³ÌªñÁ{®É¨ü©R¨ó§U¤@­Ó¨t²ÎlogÀÉ®×Âà´«¡A¦ý¥Ñ©ó¤p§Ì¨Ã¤£¼ô±xVBA¡A¤]¬d¹L³\¦h¨ç¼Æ¥Îªk¦ý¤´µLªk¸Ñ¨M°ÝÃD¡A©Ò¥H·Q¦V¤j®a½Ð±Ð
°ÝÃD¦p¤U:
logªºtxtÀɤº®e¤j­P¦p¤U
-------------- 01 --------------
Time: 2013.06.25, 00:01:10
Connect : OK!
   Model: C200
   Version: 1.0.0-1
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
SN:
   Input : AA0001
-------------- 02 --------------
Time: 2013.06.25, 00:01:20
Connect : OK!
   Model: C200
   Version: 1.0.0-9
Video :
   Jpeg Connection...Ok
   Image Check : User Stop!
-------------- 03 --------------
Time: 2013.06.25, 00:01:30
Connect : OK!
   Model: C200
   Version: 1.0.0-9
Video :
   Jpeg Connection...Ok
   Image Check : Ok
Audio In :
   Connection...Ok
   PC Listening Check : User Stop!
­ì·Qª½±µÂà¸m¡A¦ýµo²{¦¹logÀÉ®×Âà¥XªºÄæ¦ì¨Ã«D¨C¤@µ§³£¬O§¹¾ãªº¡A¥Ñ¤º®e¥i¥H¬Ý¥X---01---ºâ¬O¤@µ§§¹¾ãªº¬ö¿ý¡A02©M03«h¨Ã¨S¦³¥]§t§¹¾ãªºÄæ¦ì¬ö¿ý
¦Ó¦bµLªkÅÜ°Êlog¿é¥X®æ¦¡ªº±¡ªp¤U¡A¬°¤F¤è«K²Î­p¤ÀªR¡A»Ý­n±N¦¹¬ö¿ýÂର¾î¦¡¡A¦ý¦]Äæ¦ì¬ö¿ý¸ê®ÆµLªkª½±µÂà¸m
·Q½Ð±Ð¦U¦ì¤j¤j¥i¥H³z¹L¦³¬Æ»ò¤è¦¡Âà¸m³o¼Ëªº¸ê®Æ©O?
³Â·Ð¤F~~·PÁÂ!

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 8# Hsieh


·PÁÂHsiehª©¥D¤j¤jÀ°¦£¡A³oÃäÁÙ¦³­Ó¤p°ÝÃD
´N¬O¦ü¥G¦]¬°¦³³¡¥÷Äæ¦ì¬O¬Û¦Pªº¡A©Ò¥H·|±N¸ê®Æ¤º®eÂ\©ñ¦b¤@°_
½Ð°Ý¦³¿ìªk±N¥Lµø¬°¤£¦P¦Ó¤À¶}¶Ü¡H´N¦plog¤º®e­ì¥»ªº¶¶§Ç
«Ü¤£¦n·N«ä¦]¬°¤p§Ì¤£¬O«ÜÀ´¡A·PÁÂÀ°¦£
¦p¤U¹Ï¡]Model¡AMAC¡AVersion¡^

TOP

¦^´_ 9# kulisung
½Õ¾ãÄæ¼e´N¥i¥H¬Ý¥X¸ê®Æ¬O¦P¤@Àx¦s®æ¤À¦C¦s©ñ
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD