Junk Characters in the output XML file after Parsing

Hi
I am using DOM parser to parse an XML file.
After parsing the input XML file, i am fetching some contents
from the same and also putting the same contents in the parsed output file which is also an XML file.
The problem here is that the after putting the contents to the output XML file from the input XML file,
some junk character appears at the end of each and every tag in the outputfile.
The junk character is some thing like this : " ampersand hash thirteen and a semicolon "
(*THE MESSAGE DID NOT ACCEPT THE SYMBOLS KINDLY TRANSLATE THE ABOVE WORDINGS*
INTO SYMBOLS)
This character gets appended at the end of each and every tag in the output file due to which the output file
is not recognised as an XML file.
Please let me know as to why is this character appearing and also please suggest some solution
for the same.
-Thanks in Advance.
Edited by: itskarthik on Oct 10, 2008 7:16 AM
Edited by: itskarthik on Oct 10, 2008 7:18 AM
Edited by: itskarthik on Oct 10, 2008 7:19 AM
Edited by: itskarthik on Oct 10, 2008 7:19 AM
Edited by: itskarthik on Oct 10, 2008 7:23 AM
Edited by: itskarthik on Oct 10, 2008 7:23 AM

Wierd.
Try this piece of code. (You can always change it to use input file and output file instead of string if you want)
What is your output?
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
public class XMLTest {
     public static void main(String[] args) throws Exception {
          String input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
                              "<test>\r\n" +
                              "</test>";
          System.out.println("Input:");
          lookForCR(input);
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          Document doc = factory.newDocumentBuilder().parse( new ByteArrayInputStream(input.getBytes()) );
          Source source = new DOMSource(doc);
          ByteArrayOutputStream bArrOut = new ByteArrayOutputStream();
          Result result = new StreamResult( new StripOutputStream( bArrOut ) );
          Transformer xformer = TransformerFactory.newInstance().newTransformer();
          xformer.transform(source, result);     
          System.out.println("\nResult:");
          lookForCR(bArrOut.toString());
          System.out.println("\nDone");
     public static void lookForCR(String input) throws Exception {
          char[] chars =input.toCharArray();
          for ( char chr : chars ) {
               if (chr == 13 ) {
                    System.out.println("Has 0x0D character!!");
class StripOutputStream extends OutputStream {
     OutputStream out = null;
     public StripOutputStream(OutputStream out) {
          this.out = out;
     @Override
     public void write(int b) throws IOException {
          if ( b != 13 )
               out.write(b);
}- Roy

Similar Messages

  • Not receiving the output xml file from BPM

    Hello
    I am doing a scenario where I'd be sending two files in text format to the BPM workflow which would be using Fork and Correlation to merge these two files into one file and send the output xml file as receiver. Problem is that the two files are successfully converted into the xml messages and are displayed in SXMB_MONI but the output file which would be received from BPM engine as receiver is not being generated and displayed in SXMB_MONI as well as RWB. Please suggest any probable solution.
    Thanks.

    I don't think you can manipulate .ai files in Flex /
    AIR.

  • Special characters issue in output XML - file adapter  - SOA 10.1.3.4

    Hi,
    I use a DB adapter and File adapter to retreive data from database and create output XML file.
    For the database record which have special characters (for example ' , <, >), it will just output the same character in XML file, which cause other system to reject this XML file because of those characters.
    Anyone have this issue ? How can i resolve that ?
    Thanks

    Try converting the characters to &lt; and &gt;. This should work. Make sure the stand-alone & character is converted to & amp; (written with space as HTML will convert it back to &).
    -AR

  • Junk Characters in the Output of  Reports2.5

    I have created Report in Reports2.5 which is giving good output display
    But when I Register the Report in Oracle Apps & see output
    it shows Junk Characters in the place of Labels
    e.g. Revenue Report
    will come like sg0Revenue o7Report
    Can any-one give me the solution for this
    Regards / Shailesh ( [email protected] )

    This is probably due to the prt file that's being used to format the output. I'm willing to bet that the headings are in bold, and the prt file being used has includes some control characters to tell the printer to switch on and off bold - when you view the output file those are the characters you're seeing.
    To switch this off simply remove the control characters from the prt file being used.
    Hope this helps,
    Danny

  • Add an extra line in the output xml file

    Dear All
    My scenarios is idoc to xml file.For the resultant xml file i have to append a line  <?Test Line?> after
    <?xml version="1.0" encoding="UTF-8" ?>  while passing it to  legacy system ?
    How generate such a xml file in xi?
    Any help would be appreciated
    Thanks and regards
    uday

    Dear All
    my requirement is to generate an xml file which looks similar to
    <?xml version="1.0" encoding="UTF-8"?>
    <?TestLine?>
    <test_mt>
    <field1>123</field1>
    <field2>234</field2>
    </test_mt>
    how to add <?TestLine?>  tag?
    Hi shabrasish and rajashekar
    i am new to java and xslt mapping can you guide me  or give me links which are similar to my requirement how to proceed with this kind of mapping
    thanks
    uday

  • JAXB duplicates database records in the output XML file

    I am trying to export a database through XML file using JAXB. But i get an XML file having my records with the @XMLElement name i gave it (SMS_Database) and also another one following it with <list/> as the RootElement name. I don't know where it's coming from. Here is the code:
    import java.io.*;
    import java.sql.*;
    import java.util.ArrayList;
    import javax.xml.bind.*;
    public class Parse2Xml {
      static final String XMLBASE = "./SMS_Database.xml";
      static ArrayList<Intermed> dataList = new ArrayList<Intermed>();
      static Connection con = null;
      static PreparedStatement ps = null;
      static ResultSet rs = null;
      public static void main(String[] args) throws JAXBException, IOException {
            con = getConnection();
            try{
              ps = con.prepareStatement("SELECT * FROM SMS_Log");
              rs = ps.executeQuery();
              while (rs.next()) {
                  dataList.add(getData(rs));
              rs.close();
              ps.close();
              con.close();
            } catch (SQLException ex) {
                ex.printStackTrace();
            DataStore SMS_Database = new DataStore();
            SMS_Database.setList(dataList);
            JAXBContext context = JAXBContext.newInstance(DataStore.class);
         Marshaller m = context.createMarshaller();
         m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
         Writer w = null;
         try {
              w = new FileWriter(XMLBASE);
              m.marshal(SMS_Database, w);
         } finally {
              try {
                   w.close();
              } catch (Exception e) {
        static Connection getConnection(){
            String sqlURL = "jdbc:mysql://localhost:3306/SMSDB";
            String username = "SUNNYBEN";
            String password = "drowssap";
            try {
                try {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                } catch (InstantiationException ex) {
                    ex.printStackTrace();
                } catch (IllegalAccessException ex) {
                    ex.printStackTrace();
            } catch (ClassNotFoundException ex) {
                ex.printStackTrace();
            try {
                con = DriverManager.getConnection(sqlURL, username, password);
            } catch (SQLException ex) {
               ex.printStackTrace();
            return con;
        static Intermed getData(ResultSet rs) throws SQLException {
                Intermed mediator = new Intermed();
                mediator.setSms_id(rs.getString("sms_id"));
                mediator.setSender_id(rs.getString("sender_id"));
                mediator.setMessage(rs.getString("message"));
                mediator.setPhone_no(rs.getString("phone_no"));
                mediator.setDate_sent(rs.getString("date_sent"));
                mediator.setSchedule_date(rs.getString("schedule_date"));
                mediator.setUsername(rs.getString("username"));
                mediator.setResponse(rs.getString("response"));
                return mediator;
    import java.util.ArrayList;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    @XmlRootElement(namespace = "SMS_Database")
    class DataStore {
        @XmlElement(name = "SMS_Log")
        ArrayList<Intermed> dataList = new ArrayList<Intermed>();
        public ArrayList<Intermed> getList() {
            return dataList;
        public void setList(ArrayList<Intermed> dataList) {
            this.dataList = dataList;
    import javax.xml.bind.annotation.*;
    @XmlRootElement(name = "SMS_Log")
    @XmlType(propOrder = {"sms_id", "sender_id", "message", "phone_no", "date_sent", "schedule_date", "username", "response"})
    public class Intermed {
        private String sms_id;
        private String sender_id;
        private String message;
        private String phone_no;
        private String date_sent;
        private String schedule_date;
        private String username;
        private String response;
        public String getSms_id() {
            return sms_id;
        public void setSms_id(String sms_id) {
            this.sms_id = sms_id;
        public String getSender_id() {
            return sender_id;
        public void setSender_id(String sender_id) {
            this.sender_id = sender_id;
        public String getMessage() {
            return message;
        public void setMessage(String message) {
            this.message = message;
        public String getPhone_no() {
            return phone_no;
        public void setPhone_no(String phone_no) {
            this.phone_no = phone_no;
        public String getDate_sent() {
            return date_sent;
        public void setDate_sent(String date_sent) {
            this.date_sent = date_sent;
        public String getSchedule_date() {
            return schedule_date;
        public void setSchedule_date(String schedule_date) {
            this.schedule_date = schedule_date;
        public String getUsername() {
            return username;
        public void setUsername(String username) {
            this.username = username;
        public String getResponse() {
            return response;
        public void setResponse(String response) {
            this.response = response;
    }

    Dear All
    my requirement is to generate an xml file which looks similar to
    <?xml version="1.0" encoding="UTF-8"?>
    <?TestLine?>
    <test_mt>
    <field1>123</field1>
    <field2>234</field2>
    </test_mt>
    how to add <?TestLine?>  tag?
    Hi shabrasish and rajashekar
    i am new to java and xslt mapping can you guide me  or give me links which are similar to my requirement how to proceed with this kind of mapping
    thanks
    uday

  • Validating against schema file for the output XML file

    Hi,
      I am using XSLT for mapping. The output message is generated according to the mappings but it is not validate aganist schema of target . I am using xsd file from external defination section as target. Can any body help me in this regard.
    Thanks,
    Mallikarjun.M

    hi,
    if you talk about the schema of a target message type
    than validation only works if you use graphical
    message mapping
    not with: xslt,java, abap
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • Choose encoding of the output XML FILE

    I use XSU to generate an XML file in PL/SQL using the getXML method but I don't know how to choose the encoding.
    Can somebody help me ?

    I use XSU to generate an XML file in PL/SQL using the getXML method but I don't know how to choose the encoding. Can somebody help me ? Using XSU you can set the Encoding Tag by:
    PROCEDURE setEncodingTag(ctxHdl IN ctxType, enc IN VARCHAR2 := DB_ENCODING);
    Do you have use case that you want to do the character set conversion?

  • How to remove namespace link from the output XML

    i have to remove 'xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions"' (namespace) from the output xml file which is generated from the BIP. I need my output XML file without that namespace link, this namespace link is coming for each element.
    Anybody know how to do that please help.
    output xml file
    <?xml version="1.0" encoding="UTF-8" ?>
    <Reports version="2.00">
    <deliveryNote xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions">
    <subjectId />
    </deliveryNote>
    <deliveredReports xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions">
    <referDate>[Delivery note->H4]</referDate>
    </deliveredReports>
    <simpleReports xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions">
    <numberOfReports>2</numberOfReports>
    <nReport>
    <reportName>Xyz</reportName>
    <reportVersion>1.0</reportVersion>
    <observations>
    <numberOfObservations>15</numberOfObservations>
    <columnObservation>
    <y>9</y>
    <rO>
    <x>14</x>
    <o>11</o>
    <o>21</o>
    <o>121</o>
    </rO>
    </columnObservation>
    </observations>
    </nReport>
    </simpleReports>
    </Reports>
    my xslt file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions" >
    <xsl:output method="xml" encoding="UTF-8"/>
    <xsl:template match="/">
         <xsl:element name="Reports">
              <xsl:attribute name="version">2.00</xsl:attribute>
                   <deliveryNote>
                        <subjectId></subjectId>
                        </deliveryNote>
                   <deliveredReports>
                        <referDate>[Delivery note->H4]</referDate>
                   </deliveredReports>
                   <simpleReports>
                        <numberOfReports>2</numberOfReports>
                        <nReport>
                                  <reportName>Xyz</reportName>
                                  <reportVersion>1.0</reportVersion>
                                       <observations>
                                       <numberOfObservations>15</numberOfObservations>
                                       <columnObservation>
                                            <y>9</y>
                                            <rO>
                                                 <x>14</x>
                                                      <xsl:for-each select="TEST_XML/LIST_R1/R1">
                                                           <o><xsl:value-of select="xdoxslt:lpad(COL1,10,' ')"/></o>
                                                      </xsl:for-each>
                                            </rO>
                                       </columnObservation>
                                       </observations>
                             </nReport>
                        </simpleReports>
              </xsl:element>
    </xsl:template>
    </xsl:stylesheet>

    Please post the same in BI Publisher forum
    BI Publisher
    Thanks,
    Vino

  • Junk Characters in Report Output(While redirecting the output to text file)

    While generating the report (Reports 9i) output to a text file, I get the report output that contains junk characters. The other output formats viz. pdf, rtf have no problem.
    Please share how to correct it.
    Thanks.

    Yes, the MODE is set to Character and DESFORMAT is set to DFLT.
    Still the problem exists.
    Any idea please?

  • Want to display a space after last field in the output txt file

    hi
    I want to display a space after last field in the output txt file which is generaed by my program on utility server the last field lengyt we have defined is four and in database it is of three characters and requirement is to disppaly the last fourth field as space in the output file w hich is not shown as the txt file automatically gets closed at the third place as it is the last field in the record and ind atabase records are of therss char only but user wants to display this fourth position in the notepad output file as space ( which is last field in the output file)
    eg
    name house  street country
    record output coming in file
    ram   h3      street3  thn      now this thn which is last field the notepad get closed at thn only
    i want to display one space in last field for the whole of output file
    ie ram      h3   street3  thn(space)
        sham   h4  street4   sgp(space)  so on......
    we need to show this space in the output file as blank
    regards
    Arora

    hi Atish
    i am using
    loop at gt_sagadr_outtab into wa_sagadr_outtab
    move wa_sagadr_outtab-country to wa_sagadr_text+223(226).
    endloop
    in this last field ie country i need to display the last 226 as blank as only country key is two char in database so the last space is not shown
    i am not unsing the fM as tolb by  you
    and afterwards
    i am usning
    Concatenate 'Sagadr_' sy-datum sy-uzeit '.dat' into gv_filename_sagadr.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = gc_lfile
        OPERATING_SYSTEM              = SY-OPSYS
        PARAMETER_1                   = gc_param1
        PARAMETER_2                   = gc_send
        PARAMETER_3                   = gv_filename_sagadr
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
      IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
        FILE_NAME                     =  gv_filepath_sagadr
    EXCEPTIONS
      FILE_NOT_FOUND                = 1
      OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and lastly
    open dataset gv_filepath_sagadr for output in text mode encoding default.
        if sy-subrc eq 0.
         loop at gt_sagadr_text into wa_sagadr_text.
         transfer wa_sagadr_text to gv_filepath_sagadr.
         endloop.
        endif.
       close dataset gv_filepath_sagadr.
        if sy-subrc = 0.
        message S002 with gv_filepath_sagadr. "Files & created on Application server
        endif.
    SO NOT SURE WHERE TO USE THE CODE AND HOW

  • Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Usually that error can be cleared up by renaming the personal config folder. Turn on your OS's hidden files and then go to...
    C: > Users > your username > AppData > Roaming > Dreamweaver (version) > your language > configuration
    Rename the configuration folder configuration-old and start DW up. That should create an entirely new configuration folder and correct the menu.xml file.

  • Error after reload the standard XML file in UWL Configuration Wizard

    Hi all,
    We are working with UWL (EP7sp10) and encountered a problem. The UWL Configuration Wizard gave an error. We found on SDN/WIKI a posting with a workaround (<a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/BPX/UWL%2bConfiguration%2bWizard%2bshows%2bempty%2bdropdown">WIKI - UWL Configuration Wizard shows empty dropdown</a>)
    We tried this working around, but it did not work. We uploaded the standard XML file again. Now we cannot access the link "Customize the look of the UWL main page" in UWL Administration.
    We get a shortdump: 500   Internal Server Error
    <b>LOGS & TRACES</b>
    Exception occured during processing of Web Dynpro application sap.com/tckmcbc.uwl.ui~wd_admin/UWLControlCenterConfiguration. The causing exception is nested.
    [EXCEPTION]
    com.sap.tc.webdynpro.progmodel.context.ContextException: dropDownEntry<u>ComboMaincom</u>.sap.pct.erp.mss.Alert</u> is not a valid name for a node or attribute
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.validateName(NodeInfo.java:973)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:513)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:534)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.createTab(NavigationNodeConfiguration.java:830)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.populateTabs(NavigationNodeConfiguration.java:945)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.onActionFirstLevelNodeSelected(NavigationNodeConfiguration.java:252)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.onPlugfromListOfConfigurations(NavigationNodeConfiguration.java:223)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.wdp.InternalNavigationNodeConfiguration.wdInvokeEventHandler(InternalNavigationNodeConfiguration.java:288)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
    at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:752)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:705)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:154)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    It seems getting wrong at: dropDownEntryComboMaincom.sap.pct.erp.mss.Alert
    What do I have to do now? Also a clean XML file upload from another SNP installation did not work. 
    Best regards,
    G. Leurs
    Message was edited by:
            G. Leurs
    Message was edited by:
            G. Leurs

    Hi Leurs,
          Try doing the following:
         1. Upload the new Standard XML file from the another portal server with same support version or replace the changes u made to original and upload
         2. Remove the cache
        3. Register for all systems
        4. preview the UWL iView.
    Regards,
    Vinoth.M

  • Java - InputStream - Weird Characters in the Output!

    Hi,
    I have a software which outputs lines of numbers one by one. In another java program, I use BufferedReader as follows:
    BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream(),"US-ASCII"));
    where pr is the process which runs the software. For each line in the output stream, I try to check whether the first number in the line is greater than a certain value and if it is, I write to another file.
    The problem is, when I run the software repeatedly (in a linux cluster) like 10 simulations simultaneously, one of them have got @^@^.... characters followed by some huge numbers. So, I tried eliminating that line alone by using String.matches command but now, it seems even after that I get the error - so, I think it might mean that it is actually during the writing process that the problem occurs. I use BufferedWriter like the following to write it: (I do flush it after writing.)
    BufferedWriter out=new BufferedWriter(new FileWriter(tmp_file));
    I would greatly appreciate if someone can help. This thing really seems to be a huge bottleneck!
    Thanks,
    Senthil

    Hi ejp! Thanks - here is the code!
    import java.io.BufferedReader;
    import java.io.FileOutputStream;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.io.*;
    import java.util.*;
    //call the class file with the input xml file to simulate
    public class RunSim {
    public static void main(String[] args) {
    String[] xmlFiles = new String[] { "/home/senthil/Simulator/Dessa1.4/" args[0]};
    Scanner input=null;
    FileWriter ofw=null;
    PrintWriter out=null;
    for(String file:xmlFiles) {
    try {
    String[] command = {"java","Test",file, "10000"};
    Process pr = Runtime.getRuntime().exec(command); // run the command
    input = new Scanner(new InputStreamReader(pr.getInputStream()));
    String line=null;
    ofw=new FileWriter(file"_out.txt");
    out=new PrintWriter(ofw);
    while(input.hasNextLine()) {
    line=input.nextLine();
    System.out.println(line);
    if(line.matches("[0-9.\\s]*")) { // I included this as I didn't want the '@^' character - but still, it is being produced.
    out.println(line);
    out.flush();
    String[] str = line.split(" ");
    if(!line.equals("Badly formatted XML file")){
    if((Float.parseFloat(str[0]) >= 196)) //this is the limit upto which the process has to be run
    pr.destroy();
    else
    continue;
    out.close();
    int exitVal = pr.waitFor();
    System.out.println("Exited with error code "+exitVal);
    } catch(Exception e) {
    System.out.println(e.toString());
    e.printStackTrace();
    }

  • How open and edit the coherence.xml file?

    How can I open and edit the coherence.xml file?
    I cannot find the coherence.xml file in the coherence.jar package.
    Thank you,
    June

    If you are intent on changing the coherence.xml file, then you could use the JAR command (that comes with Java) to extract the coherence.xml file from coherence.jar and the later repackage the coherence.jar file using the udpated coherence.xml file, e.g.:
    C:\java\opt\coherence-331\lib>jar -xvf coherence.jar tangosol-coherence.xmlextracted: tangosol-coherence.xml>
    Instead of using JAR, on Windows you can associate the .JAR, .WAR and .EAR extensions with WinZip and use it to access / modify the contents of JAR files.
    However, the suggested approach is as follows, and does not include any changes to the tangosol.jar file:
    The tangosol-coherence-override-dev.xml file can be found in the coherence.jar file. After editing this file (in this case to define a unique value for the port system-property value for the multicast listener), save the file and add it to the server's classpath. When the server is executed, the values in the tangosol-coherence-override-dev.xml file will override any corresponding settings in the tangosol-coherence.xml file.Peace,
    Cameron Purdy | Oracle Coherence

Maybe you are looking for

  • Downloading podcasts in iTunes not automatic

    I missed a really good podcast of BBC Radio 4 In Our Time a couple of weeks ago because I did not run iTunes during the 7 days following the broadcast - although my computer was connected to the internet during that time and I had checked Podcasts an

  • How to use create and use cookie in portalet by jsp

    I am developing web application using JSP (JPDK_1_4). portal version is portal30 3.0.7.6.2

  • Can't sort out the following errors...

    continued from routing system message..... *****CODE**** package routingSystem; public class Router { //attributes private Machine machineArray[]; //this array is of type Machine. the name // could be different. private Machine packingMachine; //The

  • Web Gallery Web Widget after MobilMe

    I have numerous web pages that were created before the change to MMe, that have a Web Gallery widget on them. All these widgets point to the gallery on .mac. Short of deleting the old gallery widget and creating a new one, which will point to the .me

  • Make Your Families and Friends A Video for Christmas

    What are you going to give your friends/families for Christmas? Do not decide yet? Here I will give you a suggestion. You can make a video and send to them. It will be a great present for them. You may make a video from your own media source: videos,