The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] How to add column names from a database table to a headerless text file
gvanvuuren
Member Posts: 8 Contributor II
I've got a standard csv text file, but without headers, which I want to write to an existing database schema. So first I load both the csv file and the database table into RM. Then I need to extract the column names from the existing database table. Then I need to rename the default column names assigned by RM to the loaded csv file by using the extracted column names from the database. And only then can I write the modified csv file back to the database.
The problem is that I cannot seem to join the db column names with the headerless csv columns. I've tried all the operators I could think of, but it doesn't seem possible to extract the db table's meta information into a seperate row in order to prepend the row to the csv file.
I'm sure such a simple ETL task shouldn't be a problem for RM. So I'd appreciate it if someone could point me in the right direction. Is there a way to extract meta-information from a table?
Thanks
Gideon
The problem is that I cannot seem to join the db column names with the headerless csv columns. I've tried all the operators I could think of, but it doesn't seem possible to extract the db table's meta information into a seperate row in order to prepend the row to the csv file.
I'm sure such a simple ETL task shouldn't be a problem for RM. So I'd appreciate it if someone could point me in the right direction. Is there a way to extract meta-information from a table?
Thanks
Gideon
Tagged:
0
Answers
Maybe you can do the job also with some clever Transposings and Joins.
Best, Marius
thanks. I appreciate the effort. Could you please re-attach the process? I cannot see it.
But I think what's missing is an operator that appends rows to a reference table based on the column indices (and types) of the reference table, instead of expecting column names to match. I've been meaning to try my hand at writing an operator, so maybe this is my opportunity
Best
Gideon
The operators "Extract Macro", "Set Macro", "Loop Attributes", and "Rename" will do the trick.