Control Character as delimiter in a TPT script

Tools & Utilities
Enthusiast

Control Character as delimiter in a TPT script

We are exporting data using Teradata to a delimited text file using the TPT utility.We are setting the delimiter to '|'  by setting TextDelimiter Attribute of DataConnector Operator.Now we need to set the delimiter to some control character preferably based on the ascii value of the control character.Is there any possible way to do this?

 

 

 

 

 

 

 

Regards,

Indranil Roy


Accepted Solutions
Teradata Employee

Re: Control Character as delimiter in a TPT script

Yes. Use an attribute called TextDelimiterHex and assign it the hex value (in single-quotes).

 

-- SteveF
1 ACCEPTED SOLUTION
5 REPLIES
Teradata Employee

Re: Control Character as delimiter in a TPT script

Yes. Use an attribute called TextDelimiterHex and assign it the hex value (in single-quotes).

 

-- SteveF
Enthusiast

Re: Control Character as delimiter in a TPT script

Thanks @feinholz it worked fine.Now the data which is exported into delimited text also has some newline characters in the data.When I export the data using TPT the end of record marker is also LF(Line Feed) character thereby making it difficult for the downstream system to identify the end of each record.There are two ways to avert this problem:

 

  1. Can we change the End of Record marker of a TPT script?
  2. If option 1 is not possible how can we replace all the newline characters in the data before exporting the data in the TPT script?Replace function is not the desured choice because of the  performance issues.Is there any other way to do this?

--Indranil

Teradata Employee

Re: Control Character as delimiter in a TPT script

The end of record marker cannot be changed.

If you quote your fields and set QuotedData to "yes", then we support embedded newline characters as part of the field data.

 

-- SteveF
Enthusiast

Re: Control Character as delimiter in a TPT script

Yes this option worked perfectly fine.Also if there is quotecharacters is present in the data we need to escape it using 'Escapequotecharacter' property.

Else if we have any quote character  in the data  we are are getting extra quotes.

 

For instance if the data in table is like

id   name

1    Stephen \n "Murphy"

 

Exported data is like:

 

"1"|"Stephen \n ""Murphy"" "

As we can see we get extra quotes around "Murphy" unless we use the property 'Escapequotecharacter'.

Teradata Employee

Re: Control Character as delimiter in a TPT script

If you are indicating that you want every field to be quoted on output, then yes your quotes will be doubled.

That allows that same data to be read in correctly.

 

-- SteveF