Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JODF
>
Tutorial
> Replace text
The example shows you how to open a text document and replace text.
import com.independentsoft.office.odf.TextDocument; public class Example { public static void main(String[] args) { try { TextDocument doc = new TextDocument("c:\\test\\input.odt"); doc.replace("John Smith", "Mary Rose"); doc.save("c:\\test\\output.odt"); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*