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

¦p¦ó¶×¤J¦h­Ó²M³æ½s¸¹ªº¤å¦rÀÉ

¦p¦ó¶×¤J¦h­Ó²M³æ½s¸¹ªº¤å¦rÀÉ

¦U¦ì¤j¤j

¤p§Ì·Q±N¦h­Ó²M³æ½s¸¹ªº¸Ó¤å¦rÀɶפJsheet1ªí,

¨Ì·Ó¤÷¶µ½s¸¹©M¤÷¶µ¦WºÙ¥ý§@¤ÀÃþ«á,

µM«á«ö"¶µ¦¸","¤l¶µ«~¸¹","«~¦W","¨Ï¥Î¶q","³æ¦ì"©M"³Æµù",

¤À§O¨ú¥X¤º®e©M­«·s½s¸¹ÂনÄæ¦ì¦psheet2ªíA:HÄæ©Ò¥Ü

·Ð½Ð¥ý¶i ¤j¤j«ü¾É

TEST12.rar (28.04 KB)

¦^´_ 1# luke
  1. Sub Ex()
  2. Dim fs$, Mystr$, A(0 To 7), Ay()
  3. Set d = CreateObject("Scripting.Dictionary")
  4. fs = Replace(ThisWorkbook.FullName, ".xls", ".csv")
  5. Open fs For Input As #1
  6. Do Until EOF(1)
  7. Line Input #1, Mystr
  8. If InStr(Mystr, "¤÷¶µ½s¸¹") > 0 Then
  9.    fa = Split(Mystr, ":")
  10.    f1 = Trim(Replace(fa(1), "¤÷¶µ¦WºÙ", "")): f2 = Trim(fa(2))
  11. End If
  12. Mystr = Trim(Mystr)
  13. If Val(Mystr) <> 0 Then
  14. m = Trim(Right(Mystr, 3)) '³æ¦ì
  15. Mystr = Trim(Replace(Mystr, m, ""))
  16. k = Len(Mystr)
  17. Do Until Mid(Mystr, k, 1) = " "
  18. k = k - 1
  19. Loop
  20. n = Mid(Mystr, k) '¼Æ¶q
  21. Mystr = Trim(Left(Mystr, k))
  22. Mystr = Trim(Mid(Mystr, Len(Split(Mystr, " ")(0)) + 1))
  23. i = 1
  24. Do Until Mid(Mystr, i, 1) = " "
  25. i = i + 1
  26. Loop
  27. p = Trim(Left(Mystr, i)) '¤l¶µ¸¹
  28. w = Trim(Replace(Mystr, p, "")) '«~¦W
  29. d(f2) = d(f2) + 1
  30.      ReDim Preserve Ay(x)
  31.      Ay(x) = Array(f1, f2, d(f2), p, w, n, m)
  32.      x = x + 1
  33. End If
  34. Loop
  35. Sheet3.[A7].Resize(x, 7).Value = Application.Transpose(Application.Transpose(Ay))
  36. Close #1
  37. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ luke ©ó 2012-4-21 15:25 ½s¿è

¦^´_ 2# Hsieh


   ÁÂÁÂH¤j

   ²Ä35¦CÀ³¬°Sheet2.[A7]

   1.­Y¤å¦rÀɱo¥DÀɦW(TEST12.csv)»PExcelÀÉ(TEST12.xls)¤£¦P¦WºÙ®É§Y¤å¦rÀɱo¥DÀɦW ¬°¤£¦P¦WºÙ, À³¦p¦ó­×§ïµ{¦¡?

    2.­Y¤å¦rÀɬO txtÀÉ¥B±Æ¦C®æ¦¡¤º®e¤£¦P¬O§_¯àª½±µ¥´¶}ÀÉ®×
       ¦A¶×¤J¤£»Ý¸g¹Lsheet1ªíÂà¶K¦Üsheet2ªí, §Yª½±µ¶}±ÒÀÉ®×¾ã²z«á©ñ¤Jsheet1ªí
       (PS: ­ì©l¤å¦rÀɬOtxtÀÉ, §Q¥Î¶}±ÒÀɮצA¸g¹LÂà¦s¦¨csvÀÉ)

     ·Ð½Ð¥ý¶i ¤j¤j«ü¾É

TOP

¦^´_ 3# luke

fs = Replace(ThisWorkbook.FullName, ".xls", ".csv")
³o¥y´N¬O¨ú±o¤å¦rÀɪº§¹¾ãÀɦW¡A¥u­n§ï¦¨©Ò­n¶×¤JªºÀɦW§Y¥i
¾ã­Óµ{¦¡¾A¥Î©Ò¦³´`§ÇÀɮסA¥u­n¤ÀÄ檺³W«h¤@¼ËÀ³¸Ó³£¥i¦æ
©Ò¥H¤£¶·ÂনCSVÀɮסAª½±µ¶}±ÒtxtÀɮקY¥i¡A¤]¤£·|³z¹LŪ¨ú¤º®e¨ì¤u§@ªí¡A¬Oª½±µ¨Ì·Ó§Aªºtxt¤º®e³B²z
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh


    ÁÂÁÂH¤j

    ­ìµ{¦¡§ï¦¨
     fs = Application.GetOpenFilename("Text Files (*.txt), *.txt")
     
     ÂI¿ï¤å¦rÀÉ
     §ï¿ï­ìTEST12.txt¤å¦rÀÉ
     ·|¥X²{"Àɮפw¶}±Ò"¿ù»~

      ·Ð½Ð¥ý¶i ¤j¤j«ü¾É
       TEST12A.rar (23.91 KB)

TOP

¦^´_ 5# luke


¨S¦³§A»¡ªº°ÝÃD¡A¥u¬O
sheet3.[A7].Resize(x, 7).Value = Application.Transpose(Application.Transpose(Ay))
­n§ï¦¨
sheet2.[A7].Resize(x, 7).Value = Application.Transpose(Application.Transpose(Ay))
·|¥X²{³oºØª¬ªp¡A¬O¦]¬°§A¦³°õ¦æ¹Lµ{¦¡¡A¦ý¬O¨S¦³°õ¦æ¨ì
Close #1´Nµ²§ôµ{¦¡
½Ð¥H³v¦æ(F8)°õ¦æ¡AÁÙ¥¼°õ¦æOpen fs For Input As #1®É
´N¸õ¨ìClose #1°õ¦æ¦A­«·s°õ¦æµ{¦¡§Y¥i
play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD