Skip to Content

Invalid Special Characters in transformation and conversion files

Hi all,

I perused through many posts on this but im struggling to get my java script right.

I have master data from BW which contains invalid special characters and would like to replace them with valid ones for example replace “/” with “_”. In some cases I have different invalid characters in one member and I would like the correct script to change this in my conversion.

e.g. 1/456-3-4 needs to change to 1_456_3_4

I am using this javascript but it still gives warning when I run package.

Transformation:

Conversion: Im my conversion tab I have:

Many thanks

Jordan

trans.png (9.9 kB)
conv.png (4.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 16 at 08:45 AM

    Please read any online JavaScript tutorial about regular expressions!

    js: %external%.replace(/\//g,"_")

    /.../ - regular expression

    \/ - escaped /

    g - all matches

    Add comment
    10|10000 characters needed characters exceeded