Reading a Text file

  • Thread starter Thread starter Sudhesh
  • Start date Start date
S

Sudhesh

Hi,
I know its fairly easy in .NET to read a text file (fixed or
delimited) using a Microsoft Text driver. My question is, is there a
similar easy way to read text files if they have different types of
rows, like a header, detail & footer. The first character on each line
could identify what type of row that is.
I'd hate to think that reading each line is the only answer. Also
if the fields in header and footer are different, can you process them
differently. Ideally, I'd like to create a dataset with 3 tables linked
together, one each for header, detail & footer.

Cheers
Sudhesh
 
Sudhesh said:
Hi,
I know its fairly easy in .NET to read a text file (fixed or
delimited) using a Microsoft Text driver. My question is, is there a
similar easy way to read text files if they have different types of
rows, like a header, detail & footer. The first character on each line
could identify what type of row that is.
I'd hate to think that reading each line is the only answer. Also
if the fields in header and footer are different, can you process them
differently. Ideally, I'd like to create a dataset with 3 tables linked
together, one each for header, detail & footer.

Cheers
Sudhesh

Hello,
i don't think, there is a ready-to-use solution in .Net for this. I
think, that the only way is reading the file line for line and then
parse it into the three tables.

Martin Schall
 
Hi,
I know its fairly easy in .NET to read a text file (fixed or
delimited) using a Microsoft Text driver. My question is, is there a
similar easy way to read text files if they have different types of
rows, like a header, detail & footer. The first character on each line
could identify what type of row that is.
I'd hate to think that reading each line is the only answer. Also
if the fields in header and footer are different, can you process them
differently. Ideally, I'd like to create a dataset with 3 tables linked
together, one each for header, detail & footer.


I don't think the Microsoft TExt driver can do that. If the different
types of records were in separate files with a common key, you could
join them just like you would join several database tables.
 
I know its fairly easy in .NET to read a text file (fixed or
delimited) using a Microsoft Text driver. My question is, is there a
similar easy way to read text files if they have different types of
rows, like a header, detail & footer.

How can a plain text file have a header or footer?
 
Back
Top