Increment Output Txt or CSV file

Post Reply
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Increment Output Txt or CSV file

Post by vinnusea »

Hi all,
I have a process (B) which is called from Process (A). Process (A) have a while loop which is calling Process(B) for each iteration and passes single version each time it was called.
Process(B) is creates a view for passed version and exports that view to a TXT file.

Issue:
When ever the process (B) executes itis overwriting the TXT file. There is any way for me to increment the output file instead of overwriting ?

I tried alternatives like creating a bulk view with all the versions and publish but the view would be different for each version. It would be a painful job to create dynamic publish based on the version it is reading. So am looking into any easier way if i could just incitement already existing TXT /CSV file , which would be an ideal solution it seems.


Thanks for taking time.
Thanks
Vinnusea
declanr
MVP
Posts: 1817
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Increment Output Txt or CSV file

Post by declanr »

If you are writing to an output file with a static name it will always overwrite it...

Just concatenate the file name with whatever parameter you are passing in. That way you know what the file contains from the name of it as well.

If you absolutely need it to be in just 1 file then you need to go with your original method of 1 huge view or build all the separate outputs then combine them using vb (possibly started from the command line.)
Declan Rodger
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Re: Increment Output Txt or CSV file

Post by vinnusea »

Hi declanr,
Thanks for the reply. Ya i thought so but the file i generate is used by other ETL tools to load it to other systems. So i should be keeping my file name constant. Any other alternatives i can try off?

Thanks
Thanks
Vinnusea
User avatar
Alan Kirk
Site Admin
Posts: 6610
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Increment Output Txt or CSV file

Post by Alan Kirk »

vinnusea wrote:Hi declanr,
Thanks for the reply. Ya i thought so but the file i generate is used by other ETL tools to load it to other systems. So i should be keeping my file name constant. Any other alternatives i can try off?
You generate all of the original files with unique names. Then you execute a batch file to merge them together as discussed in this thread on Stack Exchange. The merged file (with its constant name) is the one that you feed to the other ETL tools.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Re: Increment Output Txt or CSV file

Post by vinnusea »

Thanks that sounds a doable solution.. Appreciate for quick response...

Thanks
Vinnusea
Thanks
Vinnusea
declanr
MVP
Posts: 1817
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Increment Output Txt or CSV file

Post by declanr »

Or just to throw 1 more idea into the mix that removes the necessity to do any work outside of tm1.

Instead of doing an output on each pass, just build up a 2d cube with a single output of that temp cube at the end.
Declan Rodger
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Re: Increment Output Txt or CSV file

Post by vinnusea »

Hi Rodger,
I created batch files to merge all the versions output txt's into single file and its working. To keep everything in TM1 side , are you advising to dump my output data into a 2D cube? and just export this 2D cube out?. Looks cleaner..
My output could be about 9Million rows ... taking the size of output of my file, would that be too much to load to a 2D cube in TM1?


-Thanks..
Thanks
Vinnusea
failurehappening
Posts: 78
Joined: Tue Nov 30, 2010 1:18 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Increment Output Txt or CSV file

Post by failurehappening »

You could always use a command line operator to write to the end of a file ( echo >> ) instead of asciioutput, as described by Robin here:

http://www.tm1forum.com/viewtopic.php?f ... 705#p45705
RHR
Post Reply