Reading file structures

jespeirer

New member
Joined
Jul 21, 2003
Messages
4
Is there a way to read a text file into a structure without manually stripping off the data you want and individually moving it to the fields?

ex

public structmyFile
name string 20 bytes;
address string 50 bytes;
zipcode string 5 bytes;

I need to read a file that is 75 bytes long and will lay into this structure in the correct format. I am using C#.

We are trying to convert a process from Cobol to C# and we have literally hundreds of different file layouts. We would like to avoid having to code set statements for every field on every file. Any help would be appreciated
 
Unfortunately, that wont work because Im more concerned with reading the file into a defined record structure.
 
Back
Top