1 Reply Latest reply on Oct 25, 2012 1:21 PM by 834498

    Writing dynamic value to a text file in Openscript

      How to write the dynamic values which i captured in a variable into a text file in openscript ? I searched throughout the user guide and i don't find any option for that. Please help, thanks in advance..
        • 1. Re: Writing dynamic value to a text file in Openscript
          One method using Export Table to CSV

          import oracle.oats.scripting.modules.basic.api.*;
          // Class DOMTable
          //export table content to a CSV file.
          public void exportToCSVFile(String filePath, boolean overWrite) throws AbstractScriptException, IOException

          DOMTable maTable = null;
          maTable.exportToCSVFile("c:\\temp\\export.csv", false);

          OR to read & write in a file

          Read a file & write in another file
          String MonFichierSource = "C:\\Documents and Settings\\jmarzolf\\My Documents\\Clients\\CD-APPS\\DataBank\\CD-APPS-SBL.csv";
          String MonFichierDest = "C:\\Documents and Settings\\jmarzolf\\My Documents\\Clients\\CD-APPS\\DataBank\\CD-APPS-SBL-2.csv";
          Scanner MonScanSrc = new Scanner(new File(MonFichierSource));
          FileWriter MonFichierDst = new FileWriter(MonFichierDest);
          while (MonScanSrc.hasNextLine()) {
          String MaLigne = MonScanSrc.nextLine();
          if (MaLigne.contains("ALL USER RESPONSIBILITY")) {