on 03-23-2018 11:23 AM
Hi,
TXT File need to be picked from SAP folder using file adapter.
After implementing below logic file can be put in other sap folder.
If quotes sign appear in line (“) then replace commas with spaces, until closing quotes sign appear (“), after that continue counting of commas as usual and in case of next quotes sign repeat the logic.
Example:
Input - 4,9,3,”55,77,66”,”1,5"
Output should be - 4,9,3,55 77 66,1 5
Can you please let me know how this can be achieved ?
Regards
Hi Vijay!
If you want to avoid the situation when FCC reacts on comma sign as the field separator within the field value, I would better try using enclosureSign and enclosureSignEsc parameters:
NameA.enclosureSign Specify a string that acts as a text delimiter. Text enclosed by such delimiters is transferred to the target structure unchanged, although the default setting is to remove all text delimiters. Separators within such texts are ignored.
If you specify xml.enclosureSign=" and xml.enclosureSignEsc="" , text enclosed in quotation marks is transferred unchanged and the quotation marks are removed.
https://help.sap.com/saphelp_nw73/helpdata/en/44/6713ec3f914ddee10000000a1553f7/frameset.htm
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use below set of code in UDF, here -in is String parameter:-
String out = "";
try {
while(in.contains("\"")) {
out = out + in.substring(0, in.indexOf("\""));
in = in.substring(in.indexOf("\"")+1, in.length());
String commaRemove = in.substring(0, in.indexOf("\"")).replaceAll(",", " ");
out = out + commaRemove;
in = in.substring(in.indexOf("\"")+1, in.length());
}
}catch (StringIndexOutOfBoundsException e) {
throw new StreamTransformationException("Error while transforming message as number of double quotes are odd."
+ "For more details please follow the error log : " + e.getLocalizedMessage());
}
return out+in;
Please note that if Double Quotes are odd, then it fail to perform its task. 😄
Can you proved more details what you want to do.
Regards,
Anoop Rai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.