Empty rows in text file

Post Reply
Dimix
Posts: 13
Joined: Fri Jan 15, 2016 2:53 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Empty rows in text file

Post by Dimix » Tue Nov 07, 2017 2:57 pm

I have a TI process that reads a text file (in this case a .rux file), and I'm using the following settings:
Capture.PNG
Capture.PNG (7.66 KiB) Viewed 157 times
The preview indicates that there are empty rows in the text file:
Capture2.PNG
Capture2.PNG (8.14 KiB) Viewed 157 times
However, empty rows seems to be ignored when processing the file in the MetaData/Data tab. This is problably by design, and for good reasons, ...but...is it possible to set up the TI process so that empty rows are included and read? Don't ask me why I want to do this. :D

Wim Gielis
MVP
Posts: 1562
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Empty rows in text file

Post by Wim Gielis » Tue Nov 07, 2017 3:14 pm

That’s by design and known.

What you can do is use the Prolog tab to ExecuteCommand a script to replace the empty lines with something. Then you are ready on time to read in the file tin the following tabs of the process.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 104 TM1 articles and a lot of custom code
Newest blog article: Delete a cube and its dimensions

Dimix
Posts: 13
Joined: Fri Jan 15, 2016 2:53 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: Empty rows in text file

Post by Dimix » Tue Nov 07, 2017 3:29 pm

Thanks Wim, good idea.

Wim Gielis
MVP
Posts: 1562
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0
Excel Version: 2016
Location: Brussels, Belgium
Contact:

Re: Empty rows in text file

Post by Wim Gielis » Tue Nov 07, 2017 3:48 pm

Have script produce its output in a different file than the .RUX file, to avoid problems in that file.
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 104 TM1 articles and a lot of custom code
Newest blog article: Delete a cube and its dimensions

Dimix
Posts: 13
Joined: Fri Jan 15, 2016 2:53 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: Empty rows in text file

Post by Dimix » Tue Nov 14, 2017 10:25 am

Maybe not the most efficient way to do it, but this is the syntax I use. It inserts a '#' for each empty row in the source file, and stores the end result in a new text file.

@(For /F "Tokens=1*Delims=:" %%A In ('FindStr/N "^" %1 '
) Do @If "%%B"=="" (Echo #) Else Echo %%B)>%2

Post Reply