![]() reader.ReadBlock(buffer, 0, lineLength) 'Translate the string using the EBCDIC encoding. Do Until reader.EndOfStream = True 'Read in a block of data from the EBCDIC file. Dim strAscii As String = String.Empty 'This variable increments every time a block of data is read Dim iLoops As Integer = 0 'Loop through the EBCDIC file. Dim writer As New IO.StreamWriter(newAsciiFilePath, False, ) 'This is a string to store the translated line. ![]() Dim reader As New IO.StreamReader(sourceEbcdicFilePath, encoding) 'Open a file to write out the data to. Dim buffer(lineLength - 1) As Char 'Open the EBCDIC file for reading using the EBCDIC encoding. ![]() Dim lineLength As Integer = 134 'Buffer used to store characters read in from the statement input file. Dim encoding As = (37) 'Set this to the length of an EBCDIC line or block. Here is the full file-to-file solution from the codeplex example: # code adapted from -> By Gary Lima# Adapted by Jim Vierra System.IOImports SystemPublic CLass EBCDICUtilsShared Sub TranslateFile(ByVal sourceEbcdicFilePath As String, _ ByVal newAsciiFilePath As String) 'Set the encoding to the EBCDIC code page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |