- ©«¤l
- 97
- ¥DÃD
- 26
- ºëµØ
- 0
- ¿n¤À
- 158
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- taichung
- µù¥U®É¶¡
- 2010-9-12
- ³Ì«áµn¿ý
- 2019-8-29
|
¥»©«³Ì«á¥Ñ lionliu ©ó 2016-1-15 14:26 ½s¿è
ÁÂÁ¨â¦ì¤jôªº¨ó§U
§Ú¤w§ä¨ì³B²z¤è¦¡¡AÁÂÁ¡C
¦b¦¹§Ú±N¥¦´£¨Ñ¤j®a°Ñ¦Ò¡G- Sub FileZM(sFile As String, sCode As String, dFile As String, dCode As String)
- Dim objStream As Object
- Set objStream = CreateObject("Adodb.Stream")
- With objStream
- .Mode = 3 'adModeReadWrite = 3 ' «ü¥Ü读/写权¡C
- .Type = 1 'adTypeBinary = 1
- .Open
- .LoadFromFile sFile
- .Position = 0
- .Type = 2
- .Charset = sCode
-
- sCode = .ReadText
- .Position = 0
- .SetEOS
- .Type = 2
- .Charset = dCode
- .WriteText sCode
- .SaveToFile dFile, 2
- .Close
- End With
- Set objStream = Nothing
- End Sub
- Sub SAVE_TXT()
- Dim I%, x%, y%, arr, FileName$
- FileName = "D:\TEST\1000724.txt"
- Open FileName For Output As #1
- Do While Sheets(1).Cells(I + 1, "A") <> ""
- Print #1, Sheets(1).Cells(I + 1, "A")
- I = I + 1
- Loop
- Close #1
- §Úì¨Ó²Ä¤@Ó¥¨¶°©I¥sfileZM³B¸Ì¬J¥i¡C
- Call FileZM(FileName, "big5", FileName, "utf-8")
-
- End Sub
½Æ»s¥N½X ¥H¤W¬O§Ú¦b¤j³°ºô¯¸©Ò§ä¨ìªº¸ê®Æ¡A§Úקï«á´N¯à¨Ï¥Î¤F
¥H¤U¬O§Ú¬Ý¨ìªº¥t¤@ºØ°µªk¤@¨Ö´£¨Ñ¡G¦ý¬O¤£²Å¦X§Úªº»Ý¨D¡C
¥L·|±N©Ò¦³¸ê®Æ¼g¤J¦P¤@¦æ¡A½Ð°Ý¬O§_¦³¤èªk¥i¥HÅý¥L¤@¦C¤@¦æ¡C
¦ý¤å¦r·í¤¤¤£n¦³ÁôÂ꺧é¦æ²Å¸¹¡C
Sub Day15_4_()
'¦h°ê»y¨¥¤å¦r¼g¤JUTF8®æ¦¡ªº¤å¦rÀÉ
Sheets(1).Select
Dim Rng As Object
Dim strData
For Each Rng In Range("A1:b9")
If Rng.Column = 1 Then
strData = strData & Rng & vbTab
ElseIf Rng.Column = 2 Then
strData = strData & Rng & vbCr
End If
Next
Debug.Print strData
Dim fsT As Object
Set fsT = CreateObject("ADODB.Stream")
fsT.Type = 2 '«ü©wÃþ«¬¡AÀx¦s¤å¦r¸ê®Æ¨Ï¥Î2
fsT.Charset = "UTF-8" '«ü©w¦r¤¸¶°¬°UTF8
fsT.Open '¶}±Ò»P¼g¤J¤G¶i¦ì¸ê®Æ¨ìª«¥ó
fsT.WriteText strData
fsT.SaveToFile "D:\Day15_4_2.txt", 2 '¼g¤J¤G¶i¦ì¸ê®Æ¨ìºÏºÐ
End Sub
¦¹ºØ¼gªk¬O§Úı±o³Ì²«Kªº¡A½Ð°Ý¬O§_¦³¤jô¥i¥H«ü¾É×¥¿¡C |
|