File size in a TI

Post Reply
Darkhorse
Posts: 141
Joined: Wed Mar 09, 2011 1:25 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2003 2007 2010 2013

File size in a TI

Post by Darkhorse »

Hi all

Im writing a maintenance TI that checks for Files in the server folder. I can count them, using scan i can define them but is there anyway to get the file size? or second to this any way i can get the folder size as well?

Thanks all
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: File size in a TI

Post by Wim Gielis »

Hello there

I'm not sure there's a direct way in TI. If yes, I would like to know about it too.
What I did in the past, was create a VBS file, execute that file with TI, let the VBS create a text file, and pick up the file again in the next TI process.

Wim
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
Darkhorse
Posts: 141
Joined: Wed Mar 09, 2011 1:25 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2003 2007 2010 2013

Re: File size in a TI

Post by Darkhorse »

hi wim,

I too built a Excel VB document to do this however im trying to move away from the need to run macros and automate my Maintenance via chores
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: File size in a TI

Post by Wim Gielis »

What I suggested above, is no Excel and macros, and can be automated through chores.
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
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: File size in a TI

Post by tomok »

Darkhorse wrote:Hi all

Im writing a maintenance TI that checks for Files in the server folder. I can count them, using scan i can define them but is there anyway to get the file size? or second to this any way i can get the folder size as well?

Thanks all
You can get a file listing with sizes by issuing a DIR command in a TI process. You can then parse that file in a second TI. There are a bunch of parameter options you can provide to the DIR to get the file in the format you want. To get all the files in a data directory and all subfolders and files you could do this:

Code: Select all

CommandLine = 'cmd /c dir /s *.* >File_Listing.txt';
ExecuteCommand(CommandLine, 0);
This will produce a file list in the default directory in TM1. If your data folder is not the default you may need to provide a folder to the DIR command. A second TI can parse File_Listing.txt, creating a File dimension and writing the particulars of each file to a cube.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Darkhorse
Posts: 141
Joined: Wed Mar 09, 2011 1:25 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2003 2007 2010 2013

Re: File size in a TI

Post by Darkhorse »

Brilliant i like it

thanks guys :D
Post Reply