November 4, 2005 at 3:54 pm
This may be a trivial problem, but I seem to be getting nowhere fast...
I am trying to load a series of flat files, each with the same structure (e.g. date, country, and value columns), but each flat file's value represents a different measure. For example, the value column in TextFile1 has a column name of "GDP", the value column in TextFile2 has a column name of "Population". As I am iterating through the files, I would like to capture the value column name in each file and include it as a new output column (e.g. Date, Country, Value, MeasureName).
I know how to iterate through the files using the foreach container. What I can't figure out is how to capture the column name so that I can use its value as a static value in a new column. Any ideas or help would be greatly appreciated.
November 7, 2005 at 8:00 am
This was removed by the editor as SPAM
November 11, 2005 at 8:30 am
I'm not 100% clear on what you are trying to do but I might look at the script component. You have to have a little VB.NET familiarity but that component gives you programmatic access to the data. Also look at the package variables, you can place and extract values from those variables. You might be able to place your column value (or whatever you are trying to do) in a package variable and then use it someplace else in your package.
November 14, 2005 at 3:45 pm
I looked at responding to this last week, did a little investigation, and decided not to look stupid. I do not see any way to get the column name for data from a flat file unless the column name is stored in the flat file. It often is, or can be configured to be there, which is why you are given the option to skip records when reading from a flat file. You would skip the first row to get the data, or only read the first row to get the column name. I don't think this is helpful enough, as I'm not giving you any information as to how to do it; but those were my thoughts last week - and it's all I have to offer today.
November 15, 2005 at 10:12 am
The column names are in the flat file, but I tell connection manager that the first row is the column names, so it doesn't load them as data. Connection manager knows the values of the column names because it uses them to label the data in the data preview. I guess they just do not expose them as properties, or at least I cannot find them.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply