Edward1981
New Member
- Joined
- Dec 30, 2009
- Messages
- 2
I'm going to convert a ASCII text file into a EBCDIC text file.
The convertion can't be achieved by FTP, because the ASCII text file includes both SBCS and DBCS and I want to leave those DBCS unconverted.
I failed to write EBCDIC characters(invisible in ASCII coding) into file.
Here is my vba code, &HC1 stands for character 'A' in EBCDIC
Public Sub test()
strTemp = ChrB(Val("&HC1"))
fileThis = "D:\workshop\test.txt"
On Error Resume Next
Kill (fileThis)
On Error GoTo 0
Open fileThis For Output As #1
Print #1, strTemp
Close #1
End Sub
After execution, test.txt file only contains a CRLF.
This code can work with visible character,eg &H41. How can I write invisible character into file? Thanks.
The convertion can't be achieved by FTP, because the ASCII text file includes both SBCS and DBCS and I want to leave those DBCS unconverted.
I failed to write EBCDIC characters(invisible in ASCII coding) into file.
Here is my vba code, &HC1 stands for character 'A' in EBCDIC
Public Sub test()
strTemp = ChrB(Val("&HC1"))
fileThis = "D:\workshop\test.txt"
On Error Resume Next
Kill (fileThis)
On Error GoTo 0
Open fileThis For Output As #1
Print #1, strTemp
Close #1
End Sub
After execution, test.txt file only contains a CRLF.
This code can work with visible character,eg &H41. How can I write invisible character into file? Thanks.
Last edited: