unix文本文件转windows文本文件
作者:admin 日期:2008-03-19
Public Function Convert_ToCrLf(FILENAME As String)
'将使用0d0a重构文本文件即回车换行
Dim src As String
Open FILENAME For Input As #1
' Input #1, src
src = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
src = Replace(src, vbCrLf, vbLf)
src = Replace(src, vbCr, vbLf)
src = Replace(src, vbLf, vbCrLf)
Open FILENAME For Binary As #1
Put #1, , src
' Open FILENAME For Output As #1
' Print #1, src
Close #1
End Function
Public Function Convert_ToLf(FILENAME As String)
'将使用0a重构文本文件即换行
Dim src As String
Open FILENAME For Input As #1
' Input #1, src
src = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
src = Replace(src, vbCrLf, vbLf)
src = Replace(src, vbCr, vbLf)
Open FILENAME For Binary As #1
Put #1, , src
' Open FILENAME For Output As #1
' Print #1, src
Close #1
End Function
'将使用0d0a重构文本文件即回车换行
Dim src As String
Open FILENAME For Input As #1
' Input #1, src
src = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
src = Replace(src, vbCrLf, vbLf)
src = Replace(src, vbCr, vbLf)
src = Replace(src, vbLf, vbCrLf)
Open FILENAME For Binary As #1
Put #1, , src
' Open FILENAME For Output As #1
' Print #1, src
Close #1
End Function
Public Function Convert_ToLf(FILENAME As String)
'将使用0a重构文本文件即换行
Dim src As String
Open FILENAME For Input As #1
' Input #1, src
src = StrConv(InputB(LOF(1), 1), vbUnicode)
Close #1
src = Replace(src, vbCrLf, vbLf)
src = Replace(src, vbCr, vbLf)
Open FILENAME For Binary As #1
Put #1, , src
' Open FILENAME For Output As #1
' Print #1, src
Close #1
End Function
评论: 0 | 引用: 0 | 查看次数: 1571
发表评论
你没有权限发表留言!