D
Dave
Ok, I have a very special case that I'm trying to work with here. I
can think of ways to accomplish it, but none are quick, and none seem
remotely like a best practice for this particular task.
My goal is to have a DataTable with a set of various types of data,
some of which are calculated (read: heavily massaged from static
data), and some of which come from a set of tab delimited files. Now,
I have a few issues that prevent this from being a normal one line
import job.
1. I do not know the format. Columns change and disappear depending on
configuration on that end. Obviously, XML storage would make much more
sense, but this comes from back in VB6 days, and while we hope to
rewrite it, that's just not going to happen soon. Thus, I know it's
tab delimited, my users will input which columns represent what I
need, and each file does have a header row.
2. Multiple files, each with a header. To make it worse, the file
format MIGHT change from file to file, such that file1 might have 108
columns and file2 may have 342 columns. However, to make it easy, both
are guaranteed by design to have at least what I need. What this
means, though, is that I can't just make a huge datatable with
everything and then get what I need from it. I must only select out
the columns I know are there and should be needed. Furthermore, all
selected files need to be in a single DataTable.
3. I somewhat mentioned this in #2, but I only need to pull out
columns that I need. Some of these files are hundreds of MB in size,
and if I'm processing several at once, well, you get the picture. I
usually only need maybe 5-15MB of that anyway.
I've already made the assumption that I first need to get the main
table out, and then form secondary datatable(s) by looping through
that data (some fairly complex massaging going on). I can do that part
fine, the part I'm having difficulty with is actually getting this
files into a single trimmed-down datatable.
Also, I'd prefer to avoid the stupid schema.ini file I've seen in
similar solutions around the web. Not sure if this is possible, but if
not then it's an incredibly dumb requirement unless I'm missing
something, but will deal with it. I guess it's still better than COM.
Appreciate any help!
Dave
can think of ways to accomplish it, but none are quick, and none seem
remotely like a best practice for this particular task.
My goal is to have a DataTable with a set of various types of data,
some of which are calculated (read: heavily massaged from static
data), and some of which come from a set of tab delimited files. Now,
I have a few issues that prevent this from being a normal one line
import job.
1. I do not know the format. Columns change and disappear depending on
configuration on that end. Obviously, XML storage would make much more
sense, but this comes from back in VB6 days, and while we hope to
rewrite it, that's just not going to happen soon. Thus, I know it's
tab delimited, my users will input which columns represent what I
need, and each file does have a header row.
2. Multiple files, each with a header. To make it worse, the file
format MIGHT change from file to file, such that file1 might have 108
columns and file2 may have 342 columns. However, to make it easy, both
are guaranteed by design to have at least what I need. What this
means, though, is that I can't just make a huge datatable with
everything and then get what I need from it. I must only select out
the columns I know are there and should be needed. Furthermore, all
selected files need to be in a single DataTable.
3. I somewhat mentioned this in #2, but I only need to pull out
columns that I need. Some of these files are hundreds of MB in size,
and if I'm processing several at once, well, you get the picture. I
usually only need maybe 5-15MB of that anyway.
I've already made the assumption that I first need to get the main
table out, and then form secondary datatable(s) by looping through
that data (some fairly complex massaging going on). I can do that part
fine, the part I'm having difficulty with is actually getting this
files into a single trimmed-down datatable.
Also, I'd prefer to avoid the stupid schema.ini file I've seen in
similar solutions around the web. Not sure if this is possible, but if
not then it's an incredibly dumb requirement unless I'm missing
something, but will deal with it. I guess it's still better than COM.
Appreciate any help!
Dave