Clean a carriage return character

Post Reply
zbhmida
Posts: 20
Joined: Thu Mar 28, 2013 10:12 am
OLAP Product: IBM Planning Analytics
Version: 2.0.93
Excel Version: 2 0 94 7
Location: Paris, France
Contact:

Clean a carriage return character

Post by zbhmida »

hi guys,

i m tring to export data from a cube using ASCIIOutput on a TurboIntegrator process, and on txt export i have a string that contain a carriage return character,

i ve tried to cleansed in the same TI with DELET (pString, SCAN(CHAR(13), pString),1) but it didnt work

do you have any other suggestion

Best regards
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Clean a carriage return character

Post by jim wood »

As long as you set your field quote character (default ") you should be ok. I guess it depends where the data is going? If it's going back in to TM1 you should be good.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
zbhmida
Posts: 20
Joined: Thu Mar 28, 2013 10:12 am
OLAP Product: IBM Planning Analytics
Version: 2.0.93
Excel Version: 2 0 94 7
Location: Paris, France
Contact:

Re: Clean a carriage return character

Post by zbhmida »

Hi Jim,

Yes its going back to TM1,
and Yes the DatasourceASCIIQuoteCharacter='';

i ll try

thank you for your reply
Zied
zbhmida
Posts: 20
Joined: Thu Mar 28, 2013 10:12 am
OLAP Product: IBM Planning Analytics
Version: 2.0.93
Excel Version: 2 0 94 7
Location: Paris, France
Contact:

Re: Clean a carriage return character

Post by zbhmida »

Well,

i have tried:

Code: Select all

nLength = Long(vValeur);
nScan = SCAN(CHAR(13), vValeur);
IF(nScan >0);
vValeur = SubSt(vValeur,1,nScan - 1) | ' ' | SubSt(vValeur,nScan + 1,nLength);
endif;
it works but the string is not loaded totally,
i explain:
LF = CHAR(13) = carriage return caracter,
pString = "tissu S31 'LF'
Partiel des fournitures 7/8" 'CR/LF'
Before i tried new code i had *ERR* on TM1 Cube, and after that i had "Tissu S31" and not all the string,

Any suggestions
Thank you in advance,
Zied
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Clean a carriage return character

Post by jim wood »

Well the only thing I can suggest is doing a scan for carriage return ascii character. I can't remember its number but I believe it has one,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Clean a carriage return character

Post by Wim Gielis »

Now it will become evident:

Code: Select all

DatasourceASCIIQuoteCharacter = '';

vValeur = 'A ' | Char( 10 ) | ' B ' | Char( 13 ) | ' C ';
AsciiOutput( 'test.txt', vValeur );

# replace CRLF
nLength = Long( vValeur );
nScan = Scan( Char(13), vValeur );
If( nScan > 0 );
vValeur = Subst( vValeur, 1, nScan - 1 ) | ' ' | SubSt( vValeur, nScan + 1, nLength );
EndIf;

AsciiOutput( 'test.txt', '' );
AsciiOutput( 'test.txt', vValeur );

# replace LF
nLength = Long( vValeur );
nScan = Scan( Char(10), vValeur );
If( nScan > 0 );
vValeur = Subst( vValeur, 1, nScan - 1 ) | ' ' | SubSt( vValeur, nScan + 1, nLength );
EndIf;

AsciiOutput( 'test.txt', '' );
AsciiOutput( 'test.txt', vValeur );
Best regards,

Wim Gielis

IBM Champion 2024
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
zbhmida
Posts: 20
Joined: Thu Mar 28, 2013 10:12 am
OLAP Product: IBM Planning Analytics
Version: 2.0.93
Excel Version: 2 0 94 7
Location: Paris, France
Contact:

Re: Clean a carriage return character

Post by zbhmida »

Thank you wim,

it works now ^^

Thk you guys
Best regards
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Clean a carriage return character

Post by Wim Gielis »

zbhmida wrote: Thu Aug 24, 2017 9:52 am Thank you wim,

it works now ^^

Thk you guys
Best regards
You're welcome 😊
Best regards,

Wim Gielis

IBM Champion 2024
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
Post Reply