Quantcast
Channel: Teradata Downloads - Tools
Viewing all articles
Browse latest Browse all 870

TPT scripting: Escaping characters in Atribute fields

$
0
0

Hello guys, I'm new to TPT and I run into 

 

Here is a snippet of my TPT code 

 DEFINE OPERATOR OS_OPERATOR
  DESCRIPTION 'OS CMD OPERATOR FOR TPT'
  TYPE OS COMMAND
  ATTRIBUTES
  (
  VARCHAR PrivateLogName = 'OS_CMD_log',
  VARCHAR OsCmd = 'awk -F "[/,]"'NR>1{printf("%s,%s,%s,%02d/%02d/%04d,%02d/%02d/%04d\n",$1,$2,$3,$4,$5,$6,$7,$8,$9)}' in_file > out_file',
  VARCHAR IgnoreError = 'NO'
  );

Basically, I'm trying to run this awk command that contains special characters that I assume don't work well with TPT ('" $)

awk -F "[/,]"'NR>1{printf("%s,%s,%s,%02d/%02d/%04d,%02d/%02d/%04d\n",$1,$2,$3,$4,$5,$6,$7,$8,$9)}' in_file > out_file

How should I write my OsCmd  attribute in order to escape these special characters ?

A general answer of how to handle attribute values that contain special characters is most welcomed :)

Forums: 

Viewing all articles
Browse latest Browse all 870

Trending Articles