Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
String stringVal = ((String)globalMap.get("myKey")); //Retrieves the value supplied to the tMap
int len = 2610; //Your String length
int count = (stringVal.length()/len) + (stringVal.length()%len > 0 ? 1 : 0); //Calculate the number of loops
for(int i = 0; i<count; i++){ //Start loops
if(i==(count-1)){ //If it is the last loop, set the String length as the end of the substring
row2.newColumn = stringVal.substring(len*i,stringVal.length());
}else{ //Otherwise use increments of len
row2.newColumn = stringVal.substring(len*i,(len*i)+len);
}
row2.newColumn1 = i+1; //return loop number (if necessary)
} //Close loop
Hi,
I know its too late for a reply. But posting it anyway as it might help someone else facing the similar issue now and going forward. It can be done using tJavaFlex as in one of earlier replies. But it can be done easily using tFileInputPositional and set "" as Row Separator and Pattern as "2610" as follows:
It should split a row (string) to multiple rows having 2610 characters in each row. So, it should generate total of 6 rows (15660 / 2610).
Hope this helps !