Page 1 of 1

how to load file dynamically with dynamic column order

Posted: Tue May 10, 2011 8:03 am
by kpradeep25
Hi,

Wonder if this can be achieved in TI. I have a requirement to load files where order and number of column changes everytime the new file arrives.I only need to load some columns from the file, these columns can be selected by column title. when I try to achieve this using formula TI process fails because TI searches column in the the fixed order . Can anyone please provide any idea how to achieve this.

Need to load only these three columns:

emp no, address and salary

from:

File 1:
emp name, dept no, salary, address

File 2:

dept no, emp name, address, salary

Re: how to load file dynamically with dynamic column order

Posted: Tue May 10, 2011 1:01 pm
by tomok
The only way I know of would be to have each column named generically in the TI and then in the file have a first record for each column that indicates what is in the column. Create a variable in the Prolog tab for each column. Then in the DATA tab you could keep a record count and if this is the first record, check the values in each column to find out what is in each. Then set a value for the variables created in the Prolog tab. Then in the Data tab, for records 2 thru whatever, you can use a series of IF statemements (looking at the values in the variables created to tell what is in the columns) to create the CellPut formulas. Good luck. Very bad design BTW.

Re: how to load file dynamically with dynamic column order

Posted: Tue May 10, 2011 2:22 pm
by ajain86

Re: how to load file dynamically with dynamic column order

Posted: Tue May 10, 2011 4:44 pm
by kpradeep25
Thanks Tom and Ankur - I will try these.