- ©«¤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
|
¦^´_ 6# acdx
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim i As Integer, objFile As Object, A As Variant
- Set objFile = CreateObject("Scripting.FileSystemObject")
- Set objFile = objFile.OpenTextFile("D:\Test.txt", 1) '¶}±Ò¤å¦rÀÉ
- A = objFile.READALL 'Ū¨ú¤å¦rÀÉ¥þ³¡¦r¦ê
- Do While InStr(A, vbCrLf) Or InStr(A, vbLf & vbLf)
- A = Replace(A, vbCrLf, vbLf) '®ø°£´_¦ì¦r¤¸
- A = Replace(A, vbLf & vbLf, vbLf) '®ø°£ªÅ¥Õ¦C
- Loop
- If Mid(A, Len(A)) = vbLf Then A = Mid(A, 1, Len(A) - 1) '²M°£³Ì«á¦r¤¸¬O´«¦æ¦r¤¸¡C
- A = Split(A, vbLf) 'Àɮפ¤¦³¸ê®Æªº¦æ,¸m¤J°}¦C
- MsgBox A(UBound(A)) 'Àɮתº³Ì«á¦³¸ê®Æªº¨º¤@¦æ
- End Sub
½Æ»s¥N½X |
|