Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

UDF for reading a particular line and storing the value in a variable

Hi Experts,

I am reading entire file content in single feild in source data type.I want to write a UDF to seach for a particular pattern(say :25: and store the value after it i.e 34535764778 detination for further use).

EX: My sample file and its has feilds like

}

point assured

Thanks

Former Member
Former Member replied

Hi

As you are passing all the date to single string field

Try simple UDF(value as cache)

String output="";
		for(int i=0;i<input.length();i++){
		    int start = input.indexOf(":25:");
		    int end = input.indexOf(":28C");
		    output = input.substring(start+4,end);
		}
return output;

Thanks

Gaurav

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question