on 2018 Jan 16 8:37 AM
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
Request clarification before answering.
Please read any online JavaScript tutorial about regular expressions!
js: %external%.replace(/\//g,"_")
/.../ - regular expression
\/ - escaped /
g - all matches
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim
I have the following members:
1021102
1425312
1/425.312
1/021.102
When I run package with the conversion file for special characters, the members with the special characters are written to BPC but the ones with no special characters are rejected (the first 2 but these should be written too)
Regards
Jordan
js: %external%.toString.replace(/\//g,"_").replace(/-/g,"_")
toString will help!
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.