G
Guest
Hi,
I have read the "how to's" on MSDN including this one,
http://msdn2.microsoft.com/en-us/library/36b93480.aspx, on reading/writing
files in C#, but haven't found something that I can put together that is
working.
The file I have is in EBCDIC, rec length = 250 and delimited by CRLF's.
What I want to do is open an EBCDIC file in Read/Write mode so I can read
the record, alter the data in a fixed set of positions (position 2, zero
based for 19 positions), and re-write the record (same file).
I have:
private const string FILE_NAME = "d:\\somefile.txt" // file that is in EBCDIC
// Create the reader for data.
FileStream fs = new FileStream(FILE_NAME, FileMode.Open,FileAccess.ReadWrite);
BinaryReader br = new BinaryReader(fs); // ??? use this or something else?
I am aware of the "Encoding" class, but am not certain if it's needed for
what I want to do.
I am also aware of the "MemoryStream" and "BinaryReader" classes, but not
sure which to use.
Any links to thorough examples or responses with code snippets would be most
useful.
Thanks.
I have read the "how to's" on MSDN including this one,
http://msdn2.microsoft.com/en-us/library/36b93480.aspx, on reading/writing
files in C#, but haven't found something that I can put together that is
working.
The file I have is in EBCDIC, rec length = 250 and delimited by CRLF's.
What I want to do is open an EBCDIC file in Read/Write mode so I can read
the record, alter the data in a fixed set of positions (position 2, zero
based for 19 positions), and re-write the record (same file).
I have:
private const string FILE_NAME = "d:\\somefile.txt" // file that is in EBCDIC
// Create the reader for data.
FileStream fs = new FileStream(FILE_NAME, FileMode.Open,FileAccess.ReadWrite);
BinaryReader br = new BinaryReader(fs); // ??? use this or something else?
I am aware of the "Encoding" class, but am not certain if it's needed for
what I want to do.
I am also aware of the "MemoryStream" and "BinaryReader" classes, but not
sure which to use.
Any links to thorough examples or responses with code snippets would be most
useful.
Thanks.