Turbo Integrator Functions - Create/Delete files/folders

Post Reply
azara
Posts: 13
Joined: Fri Apr 11, 2014 3:17 pm
OLAP Product: OLAP
Version: 10.2
Excel Version: 2010

Turbo Integrator Functions - Create/Delete files/folders

Post by azara »

Hi there,

I have to create a TI process that will create/delete files/folders.
Do you know what functions I can use?

For example, I have to create:
1. Create C:\a\b\test
2. Create C:\a\b\test\test.txt
3. Delete C:\a\b\test\

I understand that I can use ASCIIOUTPUT, TEXTOUTPUT..., but for each of them I have to define some variables.
How can I define that variables?
Is it another way to create files/folder?
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Turbo Integrator Functions - Create/Delete files/folders

Post by tomok »

There are no Ti functions to create or delete folders. Only to create and delete files. What you need to do is create a batch file or WSH (Windows Scripting Host) file and then call that in TI through the ExecuteCommand function. There are plenty of examples on this forum if you'll take the time to search.

P.S. Just be cognizant that the ability to create and delete folders. or do anything else for that matter, is going to be subject to the security privileges of the account TM1 is running under, not your privileges.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Turbo Integrator Functions - Create/Delete files/folders

Post by Wim Gielis »

azara wrote:I understand that I can use ASCIIOUTPUT, TEXTOUTPUT..., but for each of them I have to define some variables.
How can I define that variables?
Euhm... did you read the Turbo Integrator guide? ... Have a look at other topics here... Did a Google search?... And so on.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Turbo Integrator Functions - Create/Delete files/folders

Post by rmackenzie »

azara wrote:I have to create a TI process that will create/delete files/folders.
Do you know what functions I can use?
Turbo Integrator has a pretty powerful command called ExecuteCommand which can be used to interact with the Windows command line interface. That interface has numerous commands to interact with the file system. E.g. to make and remove folders, your process could include:

Code: Select all

# folder names
sFolderName1 = '"d:\tm1\robin 1"';
sFolderName2 = '"d:\tm1\robin 2"';

# create folder 
sCommand = 'cmd /c "md ' | sFolderName1 | '"';
ExecuteCommand ( sCommand, 1 );

sCommand = 'cmd /c "md ' | sFolderName2 | '"';
ExecuteCommand ( sCommand, 1 );

# remove folder
sCommand = 'cmd /c "rd /s /q ' | sFolderName2 | '"';
ExecuteCommand ( sCommand, 1 );
Robin Mackenzie
azara
Posts: 13
Joined: Fri Apr 11, 2014 3:17 pm
OLAP Product: OLAP
Version: 10.2
Excel Version: 2010

Re: Turbo Integrator Functions - Create/Delete files/folders

Post by azara »

Thanks!your answers really helped.
Post Reply