How to read updated data from a real-time generated file?

I have a question:
I want to read the 10 mostly updated data from a real time generated data file. The data in this file is accumulated. how can i read mostly recently data to an applet? and further to using this data to draw a real-time graph? pls help
kelvin t.l. tse

Hi,
I think there is no "typical" way. You will have to define a convention on how the new data are stored into the file, so as to know how to accessthem. If new data are simply put at theend of your file, you may use a RandomAccessFile to read only those lines that interest you (the 1 final lines).Otherwise, you should at least know how the data file is written.
You can know if thedata file has been modified with the File.lastModified() method. This retrurns a long value corresponding to the date and hour the file was last modified. Store that value ito you appl. and perdiodically (use a Thread), compare that value with the value returned by lastModief(). If both value are NOt equal, then the file has been updated
it's all a question of knowing how the data are stored into the datafie generated.
Be also aware that you will probably have problem when your java appl. tries to read the file at the same time it is updated by the other application. I guess when theother application writes data into the file, you will not be able to read it. So, use try{} catch statements and first check to see if you can read the file with File. canRead(). If not, simply delay the reading process by asking a Thread.yield() or Thread.delay (1000)...
vincent

Similar Messages

  • Reading data from the Real-Time Infocube

    Hi,
        I am using the FM RSDRI_INFOPROV_READ_RFC to read the data from the Real time Infocube..
    But it reads only the Closed request. Is there anyway to read the open request data from real-time infocube via program.
    Please suggest.
    Regards,
    Meiy

    Hi,
    I would assume that the function module can read the data only if its available for reporting.
    May be you can try the following: You can close the request during the function module execution time and then reopen it. Not sure if this is possible.
    Bye
    Dinesh

  • How to read a data from USB port using JAVA

    hi all,
    i need to know how to read a data from USB port using java. any API are available for java ?.........please give your valuable ideas !!!!!!!!!
    Advance Thanks!!

    You can do this. Please use this link
    [http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=uHu&q=java+read+data+from+usb+port&btnG=Search&meta=&aq=f&oq=]
    What research did you do of your own? Have you done some testing application and tried yourself??

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Can someone tell me how to delta update data from db like oracle?

    Hi gurus:
         as the title,can someone tell me how to delta update data from db like oracle?
    and can someone give me some link about the detail of delta update?
        thanks very much.
    chan

    Hi,
    Check help links
    Data Transfer with DB Connect
    http://help.sap.com/saphelp_nw04/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/frameset.htm
    http://www.bwexpert.com/downloads/DBConnectMakingDELTAABAPCode.doc
    Delta Concept
    http://help.sap.com/saphelp_nw04/helpdata/en/84/81eb588fc211d4b2c90050da4c74dc/frameset.htm
    Thanks

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

  • How can I extract the data from a Real-time Execution Trace ".log" file?

    I would like to get the data for the traces from the Real-time Execution Trace toolkit ".log" file to read in Excel and generate a report.

    Hi Chuck,
    Have you tried reading it into a text or binary file first and then generating a report using the Report Generation VIs?
    Ipshita C.
    National Instruments
    Applications Engineer

  • How to read the data from excel file and store into the table?

    Hi All,
    I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
    All the excel fields and my table columns are same.
    Can you share with me how can acheive this using LOB's?
    Thanks

    Hi OraSuirya,
    you can try with external tables .
    syntax as follows
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    For this you need to create directory
    Directory Creation syntax:
    create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
    grant read, write on directory ext_dir to <User>;
    please paste the excel file in the particular directory .
    I hope this will help you.
    Please correct me if I am wrong anywhere .
    Thanks,
    Tippu.

  • How to read the data from a file in another computer with user name and password login

    How to read read the data from a file in anohter computer which need to login with user name and password?

    duplicate post:  http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2061478
    duplicate post:  http://forums.ni.com/t5/LabVIEW/do-need-to-enter-the-user-name-and-password-when-TCP-ip/m-p/2061612
    duplicate post   http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2060682

  • How to read in data from MySQL to Authorware?

    Hi,
    I am trying to read in values from my database (MySQL) to
    authorware, but the best I am able to get is true or false.
    I would like to be able to get some data from the database
    and return it to AW as a string. Does anyone have any experience
    with this? Can anyone lend a helping hand in this endeavor?
    Thanks in advance for your help,
    Brad

    "Paul Swanson" <[email protected]>
    wrote in message
    news:[email protected]...
    > Kevin, you shouldn't need to worry about ODBC or OLEDB.
    Your PHP script
    > needs to handle the database connection, and you can use
    PHP's
    > mysql_connect() function for that. You really don't need
    to do anything
    > different for Authorware than you do for any PHP/MySQL
    application in
    > terms
    > of connecting to the database.
    >
    > My PHP script returns data to AW in the form of
    name=value pairs delimited
    > by the ampersand character. I then use the following
    code in AW to convert
    > them into lists:
    >
    > =========================
    > -- Use this routine to break queryString into name /
    value arrays.
    > -- Assumes a database query returns a string of
    name=value pairs
    > -- delimited by the ampersand (&) character.
    >
    > -- strip leading & from queryString
    > queryString := SubStr(queryString, 1,
    CharCount(queryString))
    >
    > -- break into list of individual lines
    > tempList := Replace("&", Return, queryString)
    >
    > listLength := LineCount(tempList)
    >
    > -- create empty arrays for name and value
    > name := Array("", listLength)
    > value := Array("", listLength)
    >
    > repeat with counter := 1 to listLength
    > singleLine := GetLine(tempList, counter)
    > name[counter] := GetWord(1, Replace("=", " ",
    singleLine))
    > value[counter]:= GetWord(2, Replace("=", " ",
    singleLine))
    > end repeat
    >
    > -- now you will need to add a separate calc icon with a
    routine to
    > -- read the data from the arrays. name[counter] matches
    value[counter]
    > =========================
    >
    > I follow this with another Calc icon (I could have done
    it all in one
    > calc)
    > that parses the names and assigns the values to my
    custom AW variables:
    >
    > =========================
    > -- get just the info we want, and store in variables
    >
    > repeat with counter := 1 to listLength
    > if name[counter] = "Lesson1Complete" then
    > Lesson1Complete := Number(value[counter])
    > else if name[counter] = "Lesson2Complete" then
    > Lesson2Complete := Number(value[counter])
    > else if name[counter] = "Lesson3Complete" then
    > Lesson3Complete := Number(value[counter])
    > else if name[counter] = "Lesson4Complete" then
    > Lesson4Complete := Number(value[counter])
    > else if name[counter] = "Lesson5Complete" then
    > Lesson5Complete := Number(value[counter])
    > else if name[counter] = "Lesson6Complete" then
    > Lesson6Complete := Number(value[counter])
    > else if name[counter] = "Lesson7Complete" then
    > Lesson7Complete := Number(value[counter])
    > else if name[counter] = "Lesson8Complete" then
    > Lesson8Complete := Number(value[counter])
    > else if name[counter] = "OverviewComplete" then
    > OverviewComplete := Number(value[counter])
    > else if name[counter] = "grade" then
    > score := Number(value[counter])
    > else if name[counter] = "passed" then
    > passed := Number(value[counter])
    > end if
    > end repeat
    I'd like to point out here that any time you have a series of
    variables that
    all have identical names except for a number in the variable
    name, you
    should be looking at lists. I'm surprised, Paul, that you
    have lists used
    to the extent that you're able to use Value[counter] on the
    right side of
    the equation, yet you're not using lists on the left side of
    the equation.
    Let's look at how this code could be made super simple by
    having ONE list
    variable, LessonComplete, instead of Lesson1Complete through
    Lesson8Complete.
    -- Assumes a database query returns a string of name=value
    pairs
    -- delimited by the ampersand (&) character.
    -- strip leading & from queryString
    --(note you could also not add this ampersand on the PHP
    side)
    queryString := SubStr(queryString, 1, CharCount(queryString))
    -- break into list of individual lines
    tempList := Replace("&", Return, queryString)
    listLength := LineCount(tempList)
    -- create empty arrays for name and value
    name := Array("", listLength)
    LessonComplete := []
    repeat with counter := 1 to listLength
    singleLine := GetLine(tempList, counter)
    name[counter] := GetWord(1, Replace("=", " ", singleLine))
    LessonComplete[name[counter] * 1] := GetWord(2, Replace("=",
    singleLine))
    end repeat
    -- now you will need to add a separate calc icon with a
    routine to
    -- read the data from the arrays. name[counter] matches
    value[counter]
    --No you don't...You're DONE :-)
    Also note that this is extensible...you can have Lesson 9,
    10, etc. and not
    have to change the code. You can also lower the amount of
    data being
    transmitted, because now instead of Lesson8Complete=1 all you
    need is 8=1.
    This lowers the server load and speeds the response. It has
    advantages on
    the Authorware side as well, because if, for instance, you
    had a series of
    buttons that were checked or not based on the completion, you
    could do the
    same type of loop. Separate variable names do not allow for
    that type of
    loop unless you use Eval (ugh).
    HTH;
    Amy

  • How to read the data from an internal table,when column names are known

    Hi All
    I have a specific requirement. I got an internal table with many fields (let it be my_tab).  Some of the fieldnames (column names in internal table my_tab) are stored in separate internal table(let it be my_fields).
    I need to store/read data corresponding to the fields (whose name is stored in my_fields) from my_tab.
    I am able to build dynamic table (referred by field-symbol) with respect to the given field names in my_fields.
    But i am unable to read the data corresponding to the fieldnames from my_tab.
    Please provide  me some pointer in this regard.
    Regards
    Swetabh Shukla

    HI All
    Thanks for the prompt response. I got solution for my question. Please check below thread. For quick reponse i posted my question in one more category. Thanks to all of you.
    How to read internal table w.r.t. fieldnames stored in other table

  • How to read the data from a column that is in clob data type (but XMLdata)

    Hi ,
    I have a table XYZ which has a column RESPONSE_XML in clob datatype format.we can convert it to XMLTYPE(RESPONSE_XML) to read the data in XML format.
    Now this is the DynamicXML schema file. Here I want to see all the COMMONNAME, ResourceDescribedby_VALUE into column_A, ResourceDescribedby_ResourceSpecCharacteristic_Name tags into column_B
    How can I do that .. any suggestions please ..
    Here is a sample XML:
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    _- <soap:Body>
    - <SearchResourceResponse xmlns="http://www.google.com/google.xsd">
    - <MessageElements xmlns:tns="http://www.www.google.com/google.xsd" xmlns="">
    <MessageStatus>SUCCESS</MessageStatus>
    - <MessageAddressing>
    <from>gmail</from>
    <to>Gmail SOAPTester</to>
    <messageId>1234</messageId>
    <action>SearchResource</action>
    <transactionId>OR</transactionId>
    <ServiceName>SearchResource</ServiceName>
    <ServiceVersion>1.1</ServiceVersion>
    </MessageAddressing>
    </MessageElements>
    -<SearchResponseDetails xmlns:tns="http://www.www.google.com/google.xsd" xmlns="">
    - <SubNetwork>
    - <Pipe xsi:type="icl:Trail" xmlns:icl="http://www.www.google.com/google.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <CommonName>318-223-4675</CommonName>
    <objectID>91535716980514105329</objectID>
    <SourceSystem>MARS</SourceSystem>
    - *<ResourceDescribedBy> <value>RDSSLA</value>* *<ResourceSpecCharacteristic> <name>*CentralOfficeCode</name>   </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceRelationship>
    - <Resource xsi:type="icl:Trail">
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>AssignLocationExternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>PairVerticalExternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>001</value> - <ResourceSpecCharacteristic> <name>PairVerticalInternalFormat</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>+</value> - <ResourceSpecCharacteristic> <name>PairVerticalSign</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>RDSSLA</value> - <ResourceSpecCharacteristic> <name>CentralOfficeCode</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceDescribedBy> <value>B</value>- <ResourceSpecCharacteristic> <name>EntityType</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    - <ResourceType>FeederCircuit</ResourceType>
    - <LogicalPhysicalResource>
    - <PhysicalResource xsi:type="icl:PhysicalConnector">
    <usageState>S</usageState>
    - <ResourceDescribedBy> <value>25.392</value> - <ResourceSpecCharacteristic> <name>CableLength</name> </ResourceSpecCharacteristic>
    </ResourceDescribedBy>
    </PhysicalResource>
    </LogicalPhysicalResource>
    - <TerminationPoint xsi:type="icl:TrailTerminationPoint">
    <CommonName>1000/34A</CommonName>
    - </Resource>
    </ResourceRelationship>
    <lrStatus>W</lrStatus>
    </Pipe>
    </SubNetwork>
    </SearchResponseDetails>

    you don't appear to have posted valid XML, so I can't reproduce using your example, but you will need to look at something like this:
    select xtab.common_name
      from your_table yt
          ,xmltable('/SearchResourceResponse'
              passing xmltype(yt.response_xml)
              columns
                  common_name varchar2(20) path 'SearchResponseDetails/CommonName'
          ) xtab
    ;

  • How to read the data from a sorted table

    Hi all,
    How to read data from the sorted tables. Please provide some examples.
    Thanks and regards,
    Lisa

    You can read like this :
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
      LINE-COL1 = SY-INDEX.
      LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    CLEAR LINE.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3
                    INTO LINE TRANSPORTING COL2.
    WRITE:   'SY-SUBRC =', SY-SUBRC,
           / 'SY-TABIX =', SY-TABIX.
    SKIP.
    WRITE: / LINE-COL1, LINE-COL2.

  • How to read the data from XML file and insert into oracle DB

    Hi All,
    I have below require ment.
    I will receive data in the XML file. then i need to read that data and insert into oracle tables. please let me know how this can be handled.
    Many Thanks.

    Sounds a lot like this question, only with less details.
    how to read data from XML  variable and insert into table variable
    We can only help if you provide us details to help as we cannot see what you are doing and only know what you tell us.  Plenty of examples abound on the forums that cover the topics you seek as well.

  • How to read Image data from oracle DB?

    How to read a oracle database object ORDSYS.ORDImage from oracle
    database?
    I can get a oracle.sql.STRUCT object from the database, but i can not
    find the way to convert data to a image object(like oracle.ord.im.OrdImage)
    I had used "OrdImage imgObjj1 =
    (OrdImage)rs.getCustomDatum(1, OrdImage.getFactory());"
    it's a example from oralce.
    But OracleResultSet.getCustomDatum() method is already deprecated,
    i can't find a new method to instead of it.
    Who can help me ? Thank you!
    [email protected]

    More than likely, this is the interface you will use:
    java.sql.Blob
    http://java.sun.com/j2se/1.4/docs/api/java/sql/Blob.html
    Once you get the blob, construct a Raster objects from the Bytes you receive from the blob. Then you can create an Image, ImageIcon, BufferedImage, whatever with the Raster object.
    Good luck!

Maybe you are looking for

  • Where else can i download the maps?

    i have down loaded the east coast aust maps but there is heaps missing. i read somewhere once but cant remember where that you can get maps from another site. does anyone know where else i can get them from and still function in my n95 properly.

  • How do you sign up for the MORE program and get the 50MG for free?

    I was told that if you signed up for the MORE - Cloud program you will get 50mg for Free?  I didn't receive that.  Anyone know how that works?

  • How can we change output pin for counter in X series daq

    hello every one... If this question is repeated then forgive me and direct me to that. I am using X series DAQ USB-6343. In specific instant i want counter output at specific pin and then agian for other requirement i want it to other pin. plz so me

  • Save As - XMP

    I've noticed that when I perform a Save As on a file initially, there is no option for XMP. XMP appears to be included automatically. When I perform Save As again on the file I then have an option to include/omit XMP. Is there any kind of preference

  • Convert a component to a BMP-file

    Hello! I�ve tried to convert my component where I have a chart drawn to a bmp-format file. I have picked part of the code from a Sun help page. This is how it looks: //first my lines Image image = component.createImage(component.getWidth(), component