The ASCIIOutput function creates a comma-delimited record in an ASCII output file. This function is a TurboIntegrator function and it can be used to export data, debug a TurboIntegrator process, or generate an ASCII file for many purposes. This article will show the syntax of this function and some examples of its arguments. In addition, we will discuss some common use cases of this function.

Syntax

ASCIIOutput(FileName, String1, String2, …, StringN)

 

 

 

 

Use Case 1: Export string data from a cube to an ASCII file

The file name is defined in Prolog and all output fields are strings.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Use Case 2: Export data with a header row to show column titles

We add a variable called Header in Prolog  and use the IF condition to run the first ASCIIOutput function in Data to create header row before we output the first record. After the header row is created, the first ASCIIOutput function will not run again because the value of the Header variable does not meet the IF condition (Header = 0). The source view and other code are similar to those in the Use Case 1.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Use Case 3: Export numeric data from a cube to an ASCII file

The ASCIIOutput function can only export string data. If we have numeric data, we must convert the data to string by using the NUMBERTOSTRING function. Please see an example below.