Writing data into files using VHDL Textio

Hi 
I was trying to write nos. from 1 to 8 into a text file using the below program.
process
type IntegerFileType is file of integer;
file data_out: IntegerFileType ;
variable fstatus: FILE_OPEN_STATUS;
variable coun: natural:= 1;
begin
file_open(fstatus,data_out,"myfile.txt",write_mode);
for i in 1 to 8 loop
write(data_out, coun);
coun := coun + 1;
end loop;
file_close(data_out);
wait; -- an artificial way to stop the process
end process;
But getting the below attached result..
Can you please help me out what could be wrong with the program.
Thanks & regards
Madhur

Do you want the numbers in the file to be human readable ASCII?
Then you'll need to convert your coun to a string. 
declare another variable of type line (type access to string).
do a write() to the line, then a writeline() to the file.
natural'image(coun) will convert coun to a string.
Google should help you find example code that will help.

Similar Messages

  • Error while wrting data into file using Applescript

    am using the below script for writing the file, but sometimes am getting errors like mentioned below, pls suggest..
    set filepath to POSIX path of "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
    try
        tell application "System Events"
            if file filepath exists then
                set myFile to open for access file filepath with write permission
                set fileData to read myFile
                set eof myFile to 0
                write "blah blah" to myFile
                close access myFile
            else
                return "File Not Found"
            end if
        end tell
    on error
        return false
    end try
    Error:
    "Network file permission error." number -5000 from file "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
    Also some times i will get this error, am unable to close the opened file
    "File file Macintosh HD:Library:Application Support:Macromedia:mms.cfg is already open." number -49 from file "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
    When i tried to close the ofile am getting this eror:
    on openAFile(filepath)
        try
            set fp to open for access filepath with write permission
        on error errstr number errNum
            if errNum = -49 then
                close access filepath
                set fp to open for access filepath with write permission
            else
                display dialog errstr
                return false
            end if
        end try
        return fp
    end openAFile
    set pointer to openAFile("Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
    set fileContents to read pointer
    Error
    "Can’t make \"Macintosh HD:Library:Application Support:Macromedia:mms.cfg\" into type file." number -1700 from "Macintosh HD:Library:Application Support:Macromedia:mms.cfg" to file

    if you're using HFS (colon-delimited) file paths, then you always have to prefix it with the file or alias keywords.  If you don't, Applescript will see it as a plain sting rather than a file path.  You can use POSIX (slash-delimited) paths directly.  examples:
    set filepath to POSIX path of file "Macintosh HD:Library:Application Support:Macromedia:mms.cfg"
    set fp to open for access alias filePath with write permission

  • Writing data into file from URL address

    Hi!
    I need to download file from certain url address and write it to file on my local disk. The file being downloaded is a image file and therefore
    I cannot make sure what encoding should I use. When I save file manually on disk and compare it with the file written programmatically, then
    the bytes in both files are not equal. Any smart advises are welcome.
    The code being used is:
    import java.net.*;
    import java.io.*;
    public class UrlParser {
         public static void main(String[] args) {
              String data;
              try{
                   // Construct a URL object
                   URL url = new URL("http://stockcharts.com/c-sc/sc?s=qqqq&p=D&b=3&g=0&i=t74934638175&r=4028");
                   // Open a connection to the URL object
                   String encoding = "UTF8";
                   BufferedReader html = new BufferedReader(new InputStreamReader(url.openStream(),encoding));      
                   Writer img_out = new OutputStreamWriter(new FileOutputStream("sc.gif"), encoding);
                   while((data = html.readLine()) != null) {
                        img_out.write( data );
                   img_out.close();
              } catch(MalformedURLException e) {
                   System.out.println(e);
              } catch(IOException e) {
                   System.out.println(e);
    }

    Use InputStream and OutputStream classes, not Readers/Writers. The latter are for "text" I/O, not "binary".

  • \n is not working by the time writing text into file ...

    Hi,
    I am reading each line from file and writing into another file ...
    It is writing continously in the file even if i use \n for new line ...
    Why "\n" is not working by the time writing text into file ...
    Here is my code:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Test11{
    private BufferedReader data;
    private String line=null;
    private StringBuffer buf= new StringBuffer();
    private BufferedWriter thewriter=null;
    private File file=null;
    private FileReader fr=null;
    private String inputLocation="c:\\test14.txt";
    public Test11(){ }
    public void disp(){
    try {   
    file=new File(inputLocation);
    fr = new FileReader(file);
    data = new BufferedReader(fr);
    while ((line = data.readLine()) != null) {
    buf.append(line + "\n");
    String text=buf.toString();
    thewriter = new BufferedWriter(new FileWriter("c:\\test15.txt"));
    thewriter.write(text);
    buf=null;
    thewriter.close();
    } catch(IOException e) { System.out.println("error ==="+e ); }
    public static void main(String[] args) {
    Test11 t=new Test11();
    t.disp();
    System.out.println("all files are converted...");
    I used "\n" after reading each line .. i want output file also same as input file ... how do i break each line by the time writing into text file .. "\n" is working in word pad but now working in notepad ... in note pad i am getting some thing like rectangle insted of "\n" ....
    Any help please .....
    thanks.

    \n works just fine, and every text editor in the world except Notepad understands that it is supposed to be a line-ending character. You don't have a problem, except in your choice of text editor. If somebody is forcing you to use Notepad then you'll have to output "\r\n" instead.

  • Writing to a file using log4j

    Hi ,
    I am facing an issue in rolling out file on an hourly basis. I have a source file , say usagelog_date.log which records logging, then after an hour an hour I have to separate that file , give it a different name say usagelog_date.10.log , I copy the contents of the source file into the rolling file, and make that source file empty. But after making that file empty when I am writing to the file using some threads simultaneously, I get some blank characters first and only after that the logging starts, that increases the file size to a large extent.
    My java code which does this separation is as follows.
    package com.proquest.services.usage.helper;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.nio.channels.FileLock;
    import java.util.Calendar;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    public class UsageRotator {
         private Log scpLog = LogFactory.getLog("SCPLog");
         public String rotateAndReturnFilename(String rotationdate, String location) throws Exception {
              Calendar calendar = Calendar.getInstance();
              int hour_of_day = calendar.get(Calendar.HOUR_OF_DAY);
              String rotationalTime = ((hour_of_day < 10) == true) ? "0" + hour_of_day : "" + hour_of_day;
              String rotatedFileName = null;
              File usageLoggingLogFile = new File(location + "usagelogging." + rotationdate + ".log");
              if (usageLoggingLogFile != null && usageLoggingLogFile.exists()) {
                   File usageLoggingRotatedFile = new File(location + "usagelogging." + rotationdate + "." + rotationalTime + ".log");
                   copyFile(usageLoggingLogFile, usageLoggingRotatedFile);
    //copying the contents of source file to a rolling file
                   FileOutputStream fout = new FileOutputStream();
    // making the source file empty fout.flush();               
                   usageLoggingLogFile.setWritable(true);
                   boolean isEmpty = isFileEmpty(usageLoggingLogFile);
                   if(isEmpty)     
                        scpLog.info("Existing file has been empty so it's good to proceed for looging next occurances");
                   rotatedFileName = usageLoggingRotatedFile.getName();
                   scpLog.info("Log file has been rotated to "+rotatedFileName);
              } else {
                   throw new Exception("File rotation failed : UsageLogging file couldn't be found for the supplied date");
              return rotatedFileName;
         private void copyFile(File source, File destn) throws Exception {
              FileInputStream fis = new FileInputStream(source);
         FileOutputStream fos = new FileOutputStream(destn);
         try {
         byte[] buf = new byte[1024];
         int i = 0;
         while ((i = fis.read(buf)) != -1) {
         fos.write(buf, 0, i);
         catch (FileNotFoundException e) {
         throw new Exception("[ERROR] File copy failed");
         finally {
         if (fis != null) fis.close();
         if (fos != null) fos.close();
         private boolean isFileEmpty(File file) throws Exception {
              FileReader fr = new FileReader(file);
              BufferedReader br = new BufferedReader(fr);
              boolean isEmpty = true;
              while (br.readLine() != null) {
                   isEmpty = false;
              return isEmpty;
    And my log4j file with which I am writing is
    # Default is to send information messages and above to the console
    log4j.rootLogger = DEBUG, DailyLogFileAppender
    # Logger configurations
    #log4j.logger.com.proquest.services.usage=DEBUG, DailyLogFileAppender
    log4j.logger.com.proquest.services.UsageLog=INFO, UsageLogFileAppender
    # Appender configurations
    # Define an appender which writes to a file which is rolled over daily
    log4j.appender.DailyLogFileAppender = com.proquest.services.log.PqDailyRollingFileAppenderExt
    log4j.appender.DailyLogFileAppender.File = logs/usagelogging/usagelogging-error.log
    log4j.appender.DailyLogFileAppender.DatePattern = '.'yyyy-MM-dd
    log4j.appender.DailyLogFileAppender.Append = true
    log4j.appender.DailyLogFileAppender.layout = org.apache.log4j.PatternLayout
    log4j.appender.DailyLogFileAppender.layout.ConversionPattern=%d{ISO8601} %m%n
    log4j.additivity.com.proquest.services.usage = false
    log4j.additivity.com.proquest.services.UsageLog = false
    log4j.appender.UsageLogFileAppender = com.proquest.services.log.PqDailyRollingFileAppenderExt
    log4j.appender.UsageLogFileAppender.File = logs/usagelogging/usagelogging.log
    log4j.appender.UsageLogFileAppender.DatePattern = '.'yyyy-MM-dd
    log4j.appender.UsageLogFileAppender.Append = true
    log4j.appender.UsageLogFileAppender.layout=org.apache.log4j.PatternLayout
    log4j.appender.UsageLogFileAppender.layout.ConversionPattern=%d{ISO8601} %m%n
    Can somebody please suggest me what to do, as I have been badly deadlocked into the problem.
    Thanks
    Suman

    neoghy wrote:
    ... rolling out file on an hourly basis.
    And my log4j file with which I am writing is
    #  Default is to send information messages and above to the console
    log4j.rootLogger = DEBUG, DailyLogFileAppender
    # Logger configurations
    #log4j.logger.com.proquest.services.usage=DEBUG, DailyLogFileAppender
    log4j.logger.com.proquest.services.UsageLog=INFO, UsageLogFileAppender
    # Appender configurations
    #  Define an appender which writes to a file which is rolled over daily
    log4j.appender.DailyLogFileAppender = com.proquest.services.log.PqDailyRollingFileAppenderExt
    log4j.appender.DailyLogFileAppender.File = logs/usagelogging/usagelogging-error.log
    log4j.appender.DailyLogFileAppender.DatePattern = '.'yyyy-MM-dd
    log4j.appender.DailyLogFileAppender.Append = true
    log4j.appender.DailyLogFileAppender.layout = org.apache.log4j.PatternLayout
    log4j.appender.DailyLogFileAppender.layout.ConversionPattern=%d{ISO8601} %m%n
    log4j.additivity.com.proquest.services.usage = false
    log4j.additivity.com.proquest.services.UsageLog = false
    log4j.appender.UsageLogFileAppender = com.proquest.services.log.PqDailyRollingFileAppenderExt
    log4j.appender.UsageLogFileAppender.File = logs/usagelogging/usagelogging.log
    log4j.appender.UsageLogFileAppender.DatePattern = '.'yyyy-MM-dd
    log4j.appender.UsageLogFileAppender.Append = true
    log4j.appender.UsageLogFileAppender.layout=org.apache.log4j.PatternLayout
    log4j.appender.UsageLogFileAppender.layout.ConversionPattern=%d{ISO8601} %m%nCan somebody please suggest me what to do, as I have been badly deadlocked into the problem.I assume you mean [DailyRollingFileAppender ^apache^|http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html]
    log4j.appender.DailyRollingFileAppender.DatePattern = '.'yyyy-MM-dd-HH

  • Error while loading Data into Essbase using ODI

    Hi,
    I am very new to ODI. I have installed ODI and working on Demo environment only. I havn't done any configuration. I am using Essbase Technology which is coming by default.
    I have created one sample outline in Essbase and a text file to load data into essbase using ODI.
    Following my text file.
    Time     Market     Product     Scenario     Measures     Data
    Jan     USA     Pepsi     Actual     Sales     222
    I am getting the error. I have checked in Operator. It is giving at step 6 i.e. Integration SampleLoad data into essbase.
    Here is the description.
    from com.hyperion.odi.common import ODIConstants
    from com.hyperion.odi.connection import HypAppConnectionFactory
    from java.lang import Class
    from java.lang import Boolean
    from java.sql import *
    from java.util import HashMap
    # Get the select statement on the staging area:
    sql= """select C3_C1 ""Time"",C5_C2 ""Market"",C2_C3 ""product"",C6_C4 ""Scenario"",C1_C5 ""Measures"",C4_C6 ""Data"" from "C$_0Demo_Demo_genData" where      (1=1) """
    srcCx = odiRef.getJDBCConnection("SRC")
    stmt = srcCx.createStatement()
    srcFetchSize=30
    stmt.setFetchSize(srcFetchSize)
    rs = stmt.executeQuery(sql)
    #load the data
    stats = pWriter.loadData(rs)
    #close the database result set, connection
    rs.close()
    stmt.close()
    Please help me to proceed further...

    Hi John,
    Here is the error message in execution tab....
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 20, in ?
    java.sql.SQLException: Unexpected token: TIME in statement [select   C3_C1    ""Time]
         at org.hsqldb.jdbc.jdbcUtil.sqlException(jdbcUtil.java:67)
         at org.hsqldb.jdbc.jdbcStatement.fetchResult(jdbcStatement.java:1598)
         at org.hsqldb.jdbc.jdbcStatement.executeQuery(jdbcStatement.java:194)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx4.f$0(<string>:20)
         at org.python.pycode._pyx4.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    java.sql.SQLException: java.sql.SQLException: Unexpected token: TIME in statement [select   C3_C1    ""Time]
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • How to upload data into IT0000 using ABAP-HR program

    Hello,
    I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
    Thanks in advance.
    Regards
    Prabhakar.
    Message was edited by:
            Prabhakara Muthyal

    Example code for HR_MAINTAIN_MASTERDATA to COPY IT0002
    DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
    DATA: VALUES        LIKE PPROP OCCURS 10 WITH HEADER LINE,
    RETURN        LIKE BAPIRETURN1,.
    LOOP AT INT_0002_FINAL.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-PERNR'.
          VALUES-FVAL  = INT_0002_FINAL-PERNR.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-BEGDA'.
          VALUES-FVAL  = INT_0002_FINAL-BEGDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-ENDDA'.
          VALUES-FVAL  = INT_0002_FINAL-ENDDA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-nachn'.
          VALUES-FVAL  = INT_0002_FINAL-NACHN.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gblnd'.
          VALUES-FVAL  = INT_0002_FINAL-GBLND.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-vorna'.
          VALUES-FVAL  = INT_0002_FINAL-VORNA.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-rufnm'.
          VALUES-FVAL  = INT_0002_FINAL-RUFNM.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-name2'.
          VALUES-FVAL  = INT_0002_FINAL-NAME2.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-inits'.
          VALUES-FVAL  = INT_0002_FINAL-INITS.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-famst'.
          VALUES-FVAL  = INT_0002_FINAL-FAMST.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-gbdat'.
          VALUES-FVAL  = INT_0002_FINAL-GBDAT.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-sprsl'.
          VALUES-FVAL  = INT_0002_FINAL-SPRSL.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-anzkd'.
          VALUES-FVAL  = INT_0002_FINAL-ANZKD.
          APPEND VALUES.
          VALUES-INFTY = '0002'.
          VALUES-FNAME = 'P0002-natio'.
          VALUES-FVAL  = INT_0002_FINAL-NATIO.
          APPEND VALUES.
    * maintain master data
          CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
            EXPORTING
              PERNR           = INT_0002_FINAL-PERNR
              ACTIO           = 'COP'
              BEGDA           = INT_0002_FINAL-BEGDA
    *         ENDDA           = INT_0002_FINAL-ENDDA
              SUBTY           = SPACE
              NO_ENQUEUE      = SPACE
              DIALOG_MODE        = '0'
              TCLAS              = 'A'
            IMPORTING
              RETURN1         = RETURN
            TABLES
              PROPOSED_VALUES = VALUES
    *         MODIFIED_KEYS   =
            EXCEPTIONS
              OTHERS          = 1.
          IF RETURN IS INITIAL.
            WRITE:/' Done....'.
          ELSE.
            WRITE:/   RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
          ENDIF.
          CLEAR VALUES.
          REFRESH VALUES.
        ENDLOOP.

  • Code to translate xml data into html using jaxp ?

    Hi all !!
    Could you please send me code to translate xml data into html using jaxp
    i am sending my xml file and xsl file
    its urgent
    my xml file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="scenario.xsl"?>
    <scenarioReport>
    <node name="node1">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>The cell is 124.</report>
    <action>qsdsqdqsd </action>
    </node>
    <node name="node 3">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>Result is unresolved because ...</report>
    <action>No action</action>
    </node>
    <node name="node 2">
    <netObjId>124 </netObjId>
    <result>undefined</result>
    <report>qsdqsdqs </report>
    <action>qsdsqd</action>
    </node>
    <node name="node 5">
    <netObjId>124 </netObjId>
    <result></result>
    <report> </report>
    <action> </action>
    </node>
    <node name="node 4">
    <netObjId>124 </netObjId>
    <result></result>
    <report> </report>
    <action></action>
    </node>
    </scenarioReport>
    my xsl file is::
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <html>
    <body>
    <h2> Scenario Report</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Nodename</th>
    <th align="left">netObjId</th>
    <th align="left">Result</th>
    <th align="left">Report</th>
    <th align="left">Action</th>
    </tr>
    <xsl:for-each select="scenarioReport/node">
    <tr>
    <td><xsl:value-of select="@name"/></td>
    <td><xsl:value-of select="netObjId"/></td>
    <td bgcolor="#ffffff "><xsl:value-of select="result"/></td>
    <td><xsl:value-of select="report"/></td>
    <td><xsl:value-of select="action"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

    Must be something wrong with your XSL.
    However apparently it was so urgent that you didn't have the time to look at what you posted. They just "fixed" the forum software and apparently it doesn't escape HTML that you type in any more. Or stuff that looks like HTML, either. So your post was unreadable.
    If your deadline hasn't passed, try reposting that code surrounded by [pre] and [/pre].

  • I am writing datas into a FIFO ,i am reading datas from fifo .but when i am writing datas like a a(0),a(1),a(2 like that.when i am reading dating datas a(0)comes to a(3 ) rd place .what is the reason ?

    I am writing datas into a FIFO in FPGA Target side  ,i am reading datas from fifo in windows host side  .but when i am writing datas like a a(0),a(1),a(2 like that.when i am reading dating datas a(0)comes to a(3 ) rd place, a(1) comes to a a(0) .what is the reason ?

    Please use a shorter title in your subject line and not post the entire question in therre.  (See the subject line I created.)   There is also no such word as "datas".  Data is already plural.
    Please read http://stackoverflow.com/help/how-to-ask.  Your question is hard to read because you aren't using proper punctuation and capitalization of your sentences.  It looks like one run-on sentence.
    Beyond that, it is impossible to help you solve our problem with just your question.  Please provide some more information.  Perhaps even attach code we can look at.  Show us what the data you are sending is supposed to look like, and what it actually looks like.

  • Java Embedding for writing string into file

    Hi ,
    According to my requirement I need to create a file and write string data into file.
    This string data I am getting as a output of the partner link. Their is 5 string variable which I need to write in file .
    I want to use java Embedding activity .
    So plz provide me any solution or any link.

    Hi,
    Why would you want to do this with java embeding? Why not just use the assign activity to create/concatenate the string and then write it to a file with the file adapter?
    Andre

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How to upload data into CRM using batch job

    Hello,
    I got some problem and need some hints.
    I am uploading data from a flat text file (product data) into CRM using thefunction module GUI_UPLOAD. My program starts with a selection screen whereI enter the path and the filename of the program, then I click start, and
    the data is transferred in CRM. This works perfect, and I can automaticallycreate service products in CRM.
    Here comes the PROB:
    But now I want to automize this procedure using a batch job that automatically picks up the file from the server and processes it automatically without any user interaction. BUT I always get an error saying that my function module GUI_UPLOAD can't run in batch mode. So
    anyone has an idea how to do this? Any other function modules that can run in batch mode? Any other ideas?
    Thx very much for ur help on this.

    Hi Bill,
    GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to theserver.. and in a batch job, you don't have the connection to a SAPGUI.
    So you should use following kind of coding:
    DATA MSG(100).
    OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
    MSG.
    IF sy-subrc = 0.
    DO.
    READ DATASET "FILENAM" INTO [Your internal table].
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    APPEND [Your internal table]P_DATA.
    ENDDO.
    ENDIF.
    The file should then be available on the server.
    Regards

  • Uploading Data Into CRM Using a Batch Job

    Hi,
    How can I automate the procedure of uploading data from a flat text file (product data) into CRM using the function module GUI_UPLOAD?
    Thanks,
    Rachita.

    Hi,
    GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to the server, and in a batch job, you don't have the connection to a SAPGUI. So you should use following kind of coding:
    DATA MSG(100).
    OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
    MSG.
    IF sy-subrc = 0.
    DO.
    READ DATASET "FILENAM" INTO [Your internal table].
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    APPEND [Your internal table]P_DATA.
    ENDDO.
    ENDIF.
    Reward points if found helpfull...
    Cheers,
    Siva.

  • Error While Inserting Data into table using OAF

    Hi Experts,
    I am learning OAF; i am trying into insert the data into table using OAF. I followed the below procedure.
    My table(OLF_TEST_TBL) Columns:
    EmpID (Number), Ename(VARCHAR2 100), Sal Number, and who columns.
    1. created Application Module (AM).
    package: oracle.apps.mfg.simplepg.server
    name: oaf_test_tbl_am
    2. created simple page
    name:EmployeePG
    package:oracle.apps.mfg.simplepg.webui
    3. Assigned the Application Module to Page
    4. Created Entity Object(EO)
    name:oaf_test_tbl_eo
    package:oracle.apps.mfg.simplepg.schema.server
    schema:apps
    table:OLF_TEST_TBL
    note:
    1. EMPID column is selected as primary key
    2. selected create method, remove method and validation method.
    3.checked generate default view object
    VO:
    name:olf_test_tbl_vo
    note: Entity Object was assigned to VO
    Coming To page:
    page main region:EmployeeMainRN
    1.under main region i created one more region using wizard
    selected AM and VO, region style-default single column
    2. under main region i created one more region
    region style- pagebuttonbar, ID:pagebutoonsRN
    3. under pagebuttonRN, created two submit buttons(ID:SUBMIT, ID:CANCEL).
    In AM java page:
    created a method to insert row and for commit.
    Insert Method:
    public void insertrow(){
    OAViewObject vo=(OAViewObject)getoaf_test_tbl_vo1();
    if(!vo.isPreparedForExecution()){
    vo.executeQuery();
    Row row=vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Commit Method:
    public void savaDataTooaftesttable(){
    getDBTransaction().commit();
    In EmployeeMainRN, created a controller.
    In this controller process request method, 'insertrow' method was called.
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("insertrow");
    To commit the transaction when SUBMIT button pressed, commit method was called in process form request method.
    import oracle.apps.fnd.framework.OAViewObject;
    public void processformRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("SUBMIT") != null)
    am.invokemethod("savaDataTooaftesttable");
    Error After clicking the submit button_
    I ran the page, page was opened successfully. Once i enter data and click submit button, it's giving the following error.
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example). If the browser's navigation buttons were not used, this error could have been caused by coding mistakes in application code. Please check Supporting the Browser Back Button developer guide - View Object Primary Key Comparison section to review the primary causes of this error and correct the coding mistakes.
    Cause:
    The view object oaf_test_tbl_am.oaf_test_tbl_vo1700_oaf_test_tbl_vo1_practice_test_prc1_oracle_apps_mfg_simplepg_server_oaf_test_tbl_am.oaf_test_tbl_vo1 contained no record. The displayed records may have been deleted, or the current record for the view object may not have been properly initialized.
    To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    Experts, Kindly help me why i am getting this error.
    Awating your replies.
    Thanks in advance.

    If you dont want to create message. You can throw exception like below as well
              throw new OAException("Emp Id is "+empId+" and employee name is "+empName, OAException.CONFIRMATION);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to import csv data into Oracle using c#

    Hello,
    How to import csv data into Oracle using c #. Where data to be imported 3GB in size and number of rows 7512263. I've managed to import csv data into Oracle, but the time it takes about 1 hour. How to speed up the time it takes to import csv data into oracle. Thank you.
    This is my code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
    using System.Text.RegularExpressions;
    using System.IO;
    using FileHelpers;
    using System.Data.OracleClient;
    namespace sqlloader
    class Program
    static void Main(string[] args)
    int jum;
    int i;
    bool isFirstLine = false;
    FileHelperEngine engine = new FileHelperEngine(typeof(XL_XDR));
    //Connect To Database
    string constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST="
    + "(ADDRESS=(PROTOCOL=TCP)(HOST= pt-9a84825594af )(PORT=1521 )))"
    + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=o11g)));"
    + "User Id=xl;Password=rahasia;";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
    // To Read Use:
    XL_XDR[] res = engine.ReadFile("DataOut.csv") as XL_XDR[];
    jum = CountLinesInFile("DataOut.csv");
    FileInfo f2 = new FileInfo("DataOut.csv");
    long s2 = f2.Length;
    int jmlRecord = jum - 1;
    for (i = 0; i < jum; i++)
    ShowPercentProgress("Processing...", i, jum);
    Thread.Sleep(100);
    if (isFirstLine == false)
    isFirstLine = true;
    else
    string sql = "INSERT INTO XL_XDR (XDR_ID, XDR_TYPE, SESSION_START_TIME, SESSION_END_TIME, SESSION_LAST_UPDATE_TIME, " +
    "SESSION_FLAG, VERSION, CONNECTION_ROW_COUNT, ERROR_CODE, METHOD, HOST_LEN, HOST, URL_LEN, URL, CONNECTION_START_TIME, " +
    "CONNECTION_LAST_UPDATE_TIME, CONNECTION_FLAG, CONNECTION_ID, TOTAL_EVENT_COUNT, TUNNEL_PAIR_ID, RESPONSIVENESS_TYPE, " +
    "CLIENT_PORT, PAYLOAD_TYPE, VIRTUAL_TYPE, VID_CLIENT, VID_SERVER, CLIENT_ADDR, SERVER_ADDR, CLIENT_TUNNEL_ADDR, " +
    "SERVER_TUNNEL_ADDR, ERROR_CODE_2, IPID, C2S_PKTS, C2S_OCTETS, S2C_PKTS, S2C_OCTETS, NUM_SUCC_TRANS, CONNECT_TIME, " +
    "TOTAL_RESP, TIMEOUTS, RETRIES, RAI, TCP_SYNS, TCP_SYN_ACKS, TCP_SYN_RESETS, TCP_SYN_FINS, EVENT_TYPE, FLAGS, TIME_STAMP, " +
    "EVENT_ID, EVENT_CODE) VALUES (" +
    "'" + res.XDR_ID + "', '" + res[i].XDR_TYPE + "', '" + res[i].SESSION_START_TIME + "', '" + res[i].SESSION_END_TIME + "', " +
    "'" + res[i].SESSION_LAST_UPDATE_TIME + "', '" + res[i].SESSION_FLAG + "', '" + res[i].VERSION + "', '" + res[i].CONNECTION_ROW_COUNT + "', " +
    "'" + res[i].ERROR_CODE + "', '" + res[i].METHOD + "', '" + res[i].HOST_LEN + "', '" + res[i].HOST + "', " +
    "'" + res[i].URL_LEN + "', '" + res[i].URL + "', '" + res[i].CONNECTION_START_TIME + "', '" + res[i].CONNECTION_LAST_UPDATE_TIME + "', " +
    "'" + res[i].CONNECTION_FLAG + "', '" + res[i].CONNECTION_ID + "', '" + res[i].TOTAL_EVENT_COUNT + "', '" + res[i].TUNNEL_PAIR_ID + "', " +
    "'" + res[i].RESPONSIVENESS_TYPE + "', '" + res[i].CLIENT_PORT + "', '" + res[i].PAYLOAD_TYPE + "', '" + res[i].VIRTUAL_TYPE + "', " +
    "'" + res[i].VID_CLIENT + "', '" + res[i].VID_SERVER + "', '" + res[i].CLIENT_ADDR + "', '" + res[i].SERVER_ADDR + "', " +
    "'" + res[i].CLIENT_TUNNEL_ADDR + "', '" + res[i].SERVER_TUNNEL_ADDR + "', '" + res[i].ERROR_CODE_2 + "', '" + res[i].IPID + "', " +
    "'" + res[i].C2S_PKTS + "', '" + res[i].C2S_OCTETS + "', '" + res[i].S2C_PKTS + "', '" + res[i].S2C_OCTETS + "', " +
    "'" + res[i].NUM_SUCC_TRANS + "', '" + res[i].CONNECT_TIME + "', '" + res[i].TOTAL_RESP + "', '" + res[i].TIMEOUTS + "', " +
    "'" + res[i].RETRIES + "', '" + res[i].RAI + "', '" + res[i].TCP_SYNS + "', '" + res[i].TCP_SYN_ACKS + "', " +
    "'" + res[i].TCP_SYN_RESETS + "', '" + res[i].TCP_SYN_FINS + "', '" + res[i].EVENT_TYPE + "', '" + res[i].FLAGS + "', " +
    "'" + res[i].TIME_STAMP + "', '" + res[i].EVENT_ID + "', '" + res[i].EVENT_CODE + "')";
    OracleCommand command = new OracleCommand(sql, con);
    command.ExecuteNonQuery();
    Console.WriteLine("Successfully Inserted");
    Console.WriteLine();
    Console.WriteLine("Number of Row Data: " + jmlRecord.ToString());
    Console.WriteLine();
    Console.WriteLine("The size of {0} is {1} bytes.", f2.Name, f2.Length);
    con.Close();
    static void ShowPercentProgress(string message, int currElementIndex, int totalElementCount)
    if (currElementIndex < 0 || currElementIndex >= totalElementCount)
    throw new InvalidOperationException("currElement out of range");
    int percent = (100 * (currElementIndex + 1)) / totalElementCount;
    Console.Write("\r{0}{1}% complete", message, percent);
    if (currElementIndex == totalElementCount - 1)
    Console.WriteLine(Environment.NewLine);
    static int CountLinesInFile(string f)
    int count = 0;
    using (StreamReader r = new StreamReader(f))
    string line;
    while ((line = r.ReadLine()) != null)
    count++;
    return count;
    [DelimitedRecord(",")]
    public class XL_XDR
    public string XDR_ID;
    public string XDR_TYPE;
    public string SESSION_START_TIME;
    public string SESSION_END_TIME;
    public string SESSION_LAST_UPDATE_TIME;
    public string SESSION_FLAG;
    public string VERSION;
    public string CONNECTION_ROW_COUNT;
    public string ERROR_CODE;
    public string METHOD;
    public string HOST_LEN;
    public string HOST;
    public string URL_LEN;
    public string URL;
    public string CONNECTION_START_TIME;
    public string CONNECTION_LAST_UPDATE_TIME;
    public string CONNECTION_FLAG;
    public string CONNECTION_ID;
    public string TOTAL_EVENT_COUNT;
    public string TUNNEL_PAIR_ID;
    public string RESPONSIVENESS_TYPE;
    public string CLIENT_PORT;
    public string PAYLOAD_TYPE;
    public string VIRTUAL_TYPE;
    public string VID_CLIENT;
    public string VID_SERVER;
    public string CLIENT_ADDR;
    public string SERVER_ADDR;
    public string CLIENT_TUNNEL_ADDR;
    public string SERVER_TUNNEL_ADDR;
    public string ERROR_CODE_2;
    public string IPID;
    public string C2S_PKTS;
    public string C2S_OCTETS;
    public string S2C_PKTS;
    public string S2C_OCTETS;
    public string NUM_SUCC_TRANS;
    public string CONNECT_TIME;
    public string TOTAL_RESP;
    public string TIMEOUTS;
    public string RETRIES;
    public string RAI;
    public string TCP_SYNS;
    public string TCP_SYN_ACKS;
    public string TCP_SYN_RESETS;
    public string TCP_SYN_FINS;
    public string EVENT_TYPE;
    public string FLAGS;
    public string TIME_STAMP;
    public string EVENT_ID;
    public string EVENT_CODE;
    I hope someone can give me a solution. Thanks

    The fastest way is to use external tables or sql loader (sqlldr). (If you use external tables or sql loader, you don't use C# at all).

Maybe you are looking for