Page 1 of 1

Ascii output ,blank row at end

Posted: Mon Feb 04, 2019 8:21 pm
by manu0521
Hi,

I am doing ascii ouput of few files from TI .

The file is always having a blank row at the end . We are not sure whats causing this and is there a way to not having this blank row at end .

I am pasting my TI code that extracts the file .

Prolog:
DatasourceASCIIDelimiter=Char(9);
DatasourceASCIIQuoteCharacter='';
count = 0;

Data :

IF (count = 0);
ASCIIOUTPUT('Extracts\\Countries.txt', 'All Countries', 'Area', 'Region','Country', 'CountryDescription');
ENDIF;

vLev1 =ELPAR('Countries', vElement, 1);
vLev2 =ELPAR('Countries', vLev1, 1);

vCountryAttr = ATTRS('Countries', vElement, 'Description');
IF (vCountryAttr @= '');
vCountryAttr = vElement;
ENDIF;

SetOutputEscapeDoubleQuote('Extracts\\Countries.txt', 1);
ASCIIOUTPUT('Extracts\\Countries.txt', 'All Countries', vLev2, vLev1,vElement, vCountryAttr);


count = count +1;

Any suggestions is appreciated.

Thanks,

Re: Ascii output ,blank row at end

Posted: Mon Feb 04, 2019 8:41 pm
by Wim Gielis
Hello,

You cannot avoid it. It's caused by a carriage return character after outputting the last-but-one line in the text file.
Why would it bother you ? Does a different system need to have the file without the last empty line ?

Re: Ascii output ,blank row at end

Posted: Mon Feb 04, 2019 9:03 pm
by manu0521
Yes a different system needs it without a blank line . Any workarounds.

Re: Ascii output ,blank row at end

Posted: Mon Feb 04, 2019 9:19 pm
by Wim Gielis
Maybe a batch file that removes the last character of the file ?
Or, if possible, instruct the other program to skip empty lines (which Turbo Integrator does by default -
empty lines do not give rise to Metadata and Data tab code execution).