To remove the duplicate lines in CSV file:
Groovy script:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.xml.XmlUtil;
import groovy.util.*;
//import java.io.file.*
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def myList = body.tokenize("\n")*.trim()
myList = myList.unique()
body = myList
// message.setBody(body)
message.setProperty("BusinessPartner", myList);
return message;
}
No comments:
Post a Comment