on 07-28-2015 1:37 PM
Hi,
I want to extract SAP BW master data to file but make sure commas are removed from any text. Otherwise the file which which has comma delimiters would be incorrect.
I am using "js: %external%.toString().replace(/,/g,"")" in the conversion file in EXTERNAL column. INTERNAL is set to "*",
I refer to the conversion file in the transformation file
"DESCRIPTION=EXCL_COMMAS.xls"
Doesnt seem to work.
Any ideas?
And the correct JavaScript syntax to remove comma's will be:
js: %external%.toString().replace( /\,/g, "")
You have to use "\," instead of ","
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works!
You have to do everything properly! Steps to reproduce:
Transformation file:
*OPTIONS
FORMAT = DELIMITED
HEADER = YES
DELIMITER = ,
AMOUNTDECIMALPOINT = .
SKIP = 0
SKIPIF =
VALIDATERECORDS=YES
CREDITPOSITIVE=YES
MAXREJECTCOUNT=
ROUNDAMOUNT=2
OUTPUTDELIMITER=,
SPECIFICMAPPING=YES
*MAPPING
ID=ID
EVDESCRIPTION=EVDESCRIPTION
*CONVERSION
EVDESCRIPTION=INACCT.XLS
Conversion file (INACCT.XLS):
EXTERNAL INTERNAL FORMULA
* js:%external%.toString().replace( /\,/g, "")
And result - no commas in EVDESCRIPTION
Vadim
Hi,
for some reason i am still not getting the desired result. For example, I have the columns ID, EVDESCRIPTION, ACCTYPTE.
The EVEDESCRIPTION has "Expenses, Admin,Office"
Then the file outputs - effectively missing ACCTYPE and viewing the :
1000,Expenses, Admin.
I know you mentioned using "TAB" as the delimeter. I think i had tried that but had problems. I will try again as this is correct way of doing what i am trying to do. Do i just change the DELIMITER = TAB and the OUTPUTDELIMITER=TAB too?
Is there a way i can use the delimiter ¦ (pipe)
Cheers
Hi Leo,
The sample I provide in my previous post was tested on the real system! Please, reproduce it with just 2 fields - ID and EVDESCRIPTION. Provide all screenshots! (transformation file, conversion file, export result...) If it's not working - then there is something wrong.
"Do i just change the DELIMITER = TAB and the OUTPUTDELIMITER=TAB too?" - the key is OUTPUTDELIMITER, you are exporting data!!!
Pipe: OUTPUTDELIMITER=|
Vadim
Hi Leo,
Strange idea "Otherwise the file which which has comma delimiters would be incorrect." - use file with TAB delimiter
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
3 | |
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.