Page 1 of 1

Uploading different text file as 1 TI process

Posted: Wed Sep 23, 2009 12:58 am
by appleglaze28
I was wondering if it is possible to upload all files in a foldr containing like 50 text files with the same delimited format & field order as 1 TI process? I'm still tryin to get used to using TI and I'm still scope all is possible use & process.

I'd also like to know if there'a way for TI to determine like if your text file name for example are element names of 1 of your dimensions. So it can zero those items with files in the folder and and not include those elements to be zero out during TI process. Like I have countries like all Asian countries and I only Japan & Korea would be using like offline templates. So their text file would have Japan & Korea as name and I want to make sure that only these elements would be zero out.

I just want to figure it out if this is possible than manually creating the view and double checking which files have excel existing. Or is there a better approach to this, like being able to choose which files to upload only at the same time zero out that specific data point.

Re: Uploading different textile as 1 TI process

Posted: Wed Sep 23, 2009 1:36 am
by Gregor Koch
Hi

Yes, this can be done as everything in the prolog tab is executed before you hit the data source.

1. You could create a process which cycles through the file names and executes the actual load process with the filename as parameter
While there are ways of using ExecuteCommand and batch files to create a list of files in a folder you can also cycle through the files by using the function WildcardFileSearch( Pathname, PriorFilename);
Below is an untested quick example for the process which cycles through the files.

Code: Select all

sLastFile='';

iFile=1;
WHILE(iFile<=50);


sFilePath='YourFilePath\';
sFileWildCard=sFilePath|'*.cma';
sFile=WildcardFileSearch(sFileWildcard, sLastfile);

IF(sFile@<>'');

ExecuteProcess('LoadProcess', 'pDataSource', sFile);
sLastFile=sFile;

ELSE;

iFile=50;

ENDIF;

iFile=iFile+1;

END;


2. Your load process needs to reassign the source name with the function
DatasourceNameForServer='Name';
which in this case would be equal to the parameter pDataSource.

Hope this helps and is not too confusing.

Cheers

Re: Uploading different text file as 1 TI process

Posted: Mon Nov 09, 2009 9:36 am
by appleglaze28
How do I define a Data Source Name under the Data Source tab for this scenario. I can't not define one cause I won't be able to write on the Data tab to map the dimension with the columns of my .csv file.

2. Your load process needs to reassign the source name with the function
DatasourceNameForServer='Name';
which in this case would be equal to the parameter pDataSource.

For the LoadProcess, do I define all parameters as if I'm uploading just 1 single file? or do I define it some other way?
So in creating the parameter pDataSource what would be the value I should input? Where does the DatasourceNameForServer='Name' come into play?