How To Avoid LF in source file

Post Reply
User avatar
Community Contributor
Posts: 279
Joined: Tue Jul 20, 2010 5:01 pm
OLAP Product: Cognos TM1
Version: Planning Analytics Local 2.0.3
Excel Version: 2013 2016
Location: Istanbul, Turkey

How To Avoid LF in source file

Post by mce » Wed Jan 03, 2018 3:42 pm


I am trying to load data from a text file, but text file has LF characters randomly in many places within the text.
TI is treating those LF characters as line breaks, although there should not be line breaks in those places.
I need TI avoid those LF characters. How can achive this? Any ideas?

Thanks in advance for all replies...
LF_issue.JPG (60.01 KiB) Viewed 714 times

User avatar
Posts: 1059
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.4 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: How To Avoid LF in source file

Post by qml » Wed Jan 03, 2018 4:43 pm

I think you'll have to do some sort of pre-processing of the file to remove the unwanted LF characters. You can do it directly in TI (if you have a way of recognising where the genuine new lines should be - e.g. any LF within a string enclosed in double quotes would be a candidate for removal), but it is way simpler and more elegant to write an external script (e.g. Perl or Python) to deal with the problem before you feed fixed files to TI.

As far as I know there is no way to tell TI which character is used as record separator - most typical newline characters (\r, \f, \n and some combinations thereof) will be recognised as the end of a data record.
Kamil Arendt

User avatar
Community Contributor
Posts: 553
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1, SSAS
Version: 9.5 - 10.2
Excel Version: 97 - 2013

Re: How To Avoid LF in source file

Post by macsir » Thu Jan 04, 2018 7:42 am

Yes, Perl can deal with these characters pretty easy.
In TM1,the answer is always yes though sometimes with a but....

Post Reply