Convert an entire document to Upper Case

Document created by pete_mccoy1.3055586893899446E12 Employee on Oct 30, 2014Last modified by dave_lesshafft on Mar 1, 2016
Version 2Show Document
  • View in full screen mode
There is a requirement for you to change your document from lower or mixed case to all Upper Case.
You can use a Data Process Component and use the following custom script:

 

Groovy Script:

 

import java.util.Properties;
import java.io.InputStream;

 

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
InputStream is = dataContext.getStream(i);
Properties props = dataContext.getProperties(i);

 

textContents=is.getText();
textContents=textContents.toUpperCase();
is = new ByteArrayInputStream(textContents.getBytes());

 

dataContext.storeStream(is, props);
}
1 person found this helpful

Attachments

    Outcomes