Sending data to a file

Hi,
The problem i'm having is that the data that i want to appear on the file doesnt apear fully. I want the full results of the program to be saved to a doc file but i only get the next number in the sequence. Here is my code
<code>
# import java.io.*;
# public class identify2 {
# int N=1;
# char[] BitStream=new char[569878];
# double[] Entropy=new double[30];
# int MaxLength=0;
# boolean EOF;
// read data from a text file
# void ReadData()
# System.out.println("after here would be a read data");
# try
# String fileName="f:\\malay-binary3.txt";
# File input=new File(fileName);
# PushbackReader in=new PushbackReader(new BufferedReader(new FileReader(input)));
int c = 1;
# int i = 0;
# while(c!=-1)
# {String number="";
# c = in.read();
# MaxLength+=1;
# if(c==-1)
# break;
# else
# in.unread(c);
# BitStream[i]=(char)(in.read());
# i++;
# }//end of try
# catch(EOFException e)
# {EOF=true;}
# catch(FileNotFoundException e)
# {System.err.println(e);
# return;
# catch(IOException e)
# {System.err.println("Err reading input file"+e);
# return;
# } //end of ReadData
//analyize the data (chunk and calculate the entropy )
# void processfile()
# int Find = 0,f = 0,f1 = 0,p,N_entropy,L,Length = 0, index = 0,end_index=0;
# double Probability, Local_Entropy = 0.0;
# int Frequency[] = new int[MaxLength];
# String Patterns[] = new String[MaxLength];
# String Pattern = "";
# Length = MaxLength;
# for( N = 1; N <=3; N++ )
# System.out.println("When N=" + N);
// for every fixed length N has N entropy
# for ( N_entropy=0;N_entropy< N ;N_entropy++ )
# L = Length - N_entropy;
# index = N_entropy;
# end_index = index + (L / N -1) * N ;
# for ( index = N_entropy; index<=end_index; index+=N )
# for ( p= index; p < index+N; p++ )
# Pattern += BitStream[p];
# for (int m=0; m<f; m++ )
# if( Patterns[m].equals(Pattern) && (Find==0) )
# { Find = 1;
# f1 = m;
# if (Find == 1)
# { Frequency[f1] += 1;
# Pattern = "";
# Find = 0;
# else
# Patterns[f] = Pattern;
# Frequency[f] += 1;
# f +=1;
# Pattern = "";}
} //end of for index
# f=0;
# int Patterns_N = L/N; //how many patterns of N length contains in the BitStream
# do
{ Probability = (double)(Frequency[f])/(double)(Patterns_N); //Probability of Patterns
# Local_Entropy += Probability * ( Math.log(Probability)/Math.log(2));
# f+=1;
# while (Frequency[f]!=0);
# Entropy[N_entropy] = (-Local_Entropy);
# System.out.println("Entropy(" + N_entropy + ")=" + Entropy[N_entropy]);
// initialize the variables
# f=0;
# for (int i=0;i<MaxLength;i++)
# {Frequency[i] =0;
# Patterns[i] = "";}
# Pattern="";
# f=0;f1=0;
# Find=0;
# Local_Entropy=0;
# p=0;
# System.out.println();
# }//end of for "N"
//output the result to a text file
# void writeData()
# try
# String fileName="f:\\test86.doc";
# File output=new File(fileName);
# output.createNewFile();
# if(!output.isFile())
# {System.out.println("Creating"+output.getPath()+"failed.");
# return;
# BufferedWriter out=new BufferedWriter(new FileWriter(output.getPath(),true));
# out.write("Then entropy of length " + N + ":" + "\n");
# for( int i = 0; i < N; i++ )
# //System.out.println("En="+Entropy[i]);
# out.write(Double.toString( Entropy[i] ) + "\n");
# out.write( "\n" );
# out.close();
# }//end of try
# catch(IOException e)
# {System.out.println("Error writing the file"+e);}
}// end of writeData
//main class
# public static void main(String[] args)
# identify2 test=new identify2();
# test.ReadData();
# test.processfile();
# test.writeData();
<code>
it should give me the following when it is saved to the doc file
after here would be a read data
When N=1
Entropy(0)=1.0000741842259357
When N=2
Entropy(0)=1.9998076934003925
Entropy(1)=1.99996372281124
When N=3
Entropy(0)=2.994268823400294
Entropy(1)=2.993906140011204
Entropy(2)=2.9948443499810233
but it gives me
Then entropy of length 4:
2.994268823400294
2.993906140011204
2.9948443499810233
0.0
Any help would be greatly apperciated. Thank you for your help in advance

You would want to use the LoadVars class, look that up in the
Flash Help and do a liitle reading to become fimilar with it,
you'll still need to write your PHP file as well.

Similar Messages

  • Sending data from flat file or oracle table view to a IBM MQ

    Hi,
    We need a help in developing solution.
    We have a scenario, where data(multiple records) in source (table/file) needs to populated into a queue(JMS IBM MQ) as a single message. To achieve this we are trying a two step process.
    1)     We created a temp table to store multiple records from file, this temp table is having one column of *‘clob’* data-type which will store data from file into a single row. We are facing issue while loading data from file to staging area using LKM FILE TO ORACLE (SQLLDR)
    When we are executing interface, while creating C$ table it is going error out . Instead of taking clob (target write data type) it is taking varchar with +5000+ size whereas varchar supports only *4000*.
    create table SNPM.C$_0SINGLERECORD
    C1_C1 VARCHAR2(5000) NULL
    NOLOGGING
    Error message:
    910 : 42000 : java.sql.SQLException: ORA-00910: specified length too long for its datatype
    java.sql.SQLException: ORA-00910: specified length too long for its datatype
    Need help in sending data into destination table.
    2) After populating this data into destination(temp table) as a single record we need to send each row as a single message to JMS MQ. currently we are using LKM FILE to SQL to load into Staging area and IKM SQL TO JMS APPEND to put message in JMS MQ. We are succeeding in putting message of length < 4000 as these KMs are converting the data using varchar2, but we have data of large size+(>4K)+.
    Pointer/ solution will be of great help.
    Please let me know in case you need more description.

    The error message that is showing while using clob as datatype(which we created as user data type in data types section of respective technology)
    java.lang.NumberFormatException: For input string: "4294967295"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
    while using varchar2 in creating C$ table following is the error:
    910 : 42000 : java.sql.SQLException: ORA-00910: specified length too long for its datatype
    java.sql.SQLException: ORA-00910: specified length too long for its datatype
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)

  • Send data using exel file to function generator

    Hi all,
    I have one function generator which I controll with LabVIEW, I attached here the simple code.
    I would like that code read some data from exel file .
    May you please help me?
    Thanks
    Attachments:
    DG4000General.vi ‏43 KB

    I used different example like the one that I attached but I can not connect with m device.
    Now I can read my datas from Exel but how can I send to generator?
    I really confused.
    thanks in advance
    Attachments:
    Untitled 1.vi ‏34 KB

  • Simple question: sending data from as file to a swf

    hi,
    I'm new to AS3 language, so maybe this is a silly question.
    I'm using a Flash 3D visualization tool (Flare3D) to display 3D contents in flash.
    the project consist of a blank fla project and a .as file (main.as) that manage the creation and the diplay of 3D contents.
    Now I want to display the name of the 3D object that I select in a text box created in the fla.
    I wrote:
    in main.as
         var selectedMesh:String = e.target.name                //the 3D object I select
    in step1.fla, frame 1
         root.infoBox.infoBoxText.text = selectedMesh;          //where I want to display the name of the object I've selected
    When I publish the swf file, it report two errors:
    1180: Call to a possibly undefined method addFrameScript.
    1119: Access of possibly undefined property infoBox through a reference with static type flash.display:DisplayObject.
    what's the problem with that? maybe I nedd to extend movieClip class in main.as or something else?
    thank you

    First, you need to post more verbose errors with line numbers - figuring what lines of code from which object throw errors and will help you to pinpoint the source. Then post these offensive lines.
    Otherwise it is practically impossible to give you any suggestions (this is unless one has a christal ball)

  • Getting error while try to send data to matmas05 idoc

    hello frnds,
    i m working on a scenario in which i m sending data from xml file to matmas05 idoc of R/3. here i have done all the required XI settings. at sender side i have used file adapter and at reciever side IDOC Adapter. while i m executing my schenario at that time i m getting green flag into the sxmb_moni transaction but m not able to see any idoc generated at the receiver R/3.
    can anybody tell me that what might be the problem? is it the problem with R/3 receiver or it is the problem with XI configuration itself..
    Regards,
    Hetal

    hi,
    if the flag is green you can check in SMQ1, SMQ2
    for any waiting entries
    I hope you've activated the queues in SXMB_ADM
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Write data  in  a file ?

    Hi ,
    I have a question regarding writing data in a text file. I have a lot of classes which are having lot of println statements. Can we send data to a file which are coming from different classes. I need to update file in sequencial way which are coming from different classes. I tried it . but it doesn't stored. can anyone rectify me.
    here is sample code ;
    in main method
       try {
      BufferedReader inFile = new BufferedReader(new FileReader(fileName));
      PrintWriter out = new PrintWriter(new FileWriter("OutFile.txt"));
    // calling  classA methods
    // calling classB methods
       out.close();           
       inFile.close();
       catch (IOException e) {
             System.exit(1);
    classA
      public void  method1()
      out.println(" message from classA - method1 ");
    public method2()
      out.println(" message from classA - method2");
    classB
      public void  method1()
      out.println(" message from classB - method1 ");
    public method2()
      out.println(" message from classB - method2");
    }  I need to call different methods in different times and update in a text file. can we do it ? Can anyone give suggestions for me.
    Thanks in advance,
    -balaji

    boss u r doing it a wrong way
    try this way
    create a method
    for writing file and pass a string parameter like this
    public void createLog(String data)
    try
    FilwWriter f=new FileWriter(new File("output.txt"))
    f.write(data)
    f.close();
    catch(Exception e)
    and whichevr class u want to enter data in text file just call this method
    createLog(" message from classA - method2");
    createLog(" message from classA - method1")
    createLog(" message from classB - method3")

  • Vaildating File name with the data in the file using sender file adapter

    Hi,
    Below is the scenario
    1)       Pick up files from a FTP server, the file name is dynamic, how do I put dynamic name in sender file adapter?
    2)       Determine if the user correctly named the file based on data in the file.
    a.       File naming structure that we will be concerned with is <company_code><accounting_time_period>.<extension>
    b.      The company code and the time period in the file name have to match the data in the file.
    i.      For example.  If the file name is 1001_200712.csv and the data in the file is for company code 1005, time period 200712, the file is incorrectly named.  Both values must be correct.
    How do we do this?

    Hi Sachin,
                    As Rightly said by Krishna, You can not put Dynamic name in sender File Adapter .You have to provide the name of the file like "*.txt" in Sender Adapter and at runtime you can access this file name by using following UDF:
    DynamicConfiguration conf  = (DynamicConfiguration) container
      .getTransformationParameters()
      .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String valueOld = conf.get(key);
    return (valueOld);
    As now you have picked up the file name at runtime.
    Now concatenate source file fields Company_code and Accounting_timeperiod using "_" as delimiter in properties.Also concat the extension .Now you have required file name.
    So using EQUALS standard function ,compare it with File Name fetched at runtime using above given UDF, and pass result as you desire to process further or not or to raise Alert to resend the file.
    Thanks & Regards,
    Anurag Garg
    You can validate this file name in Mapping itself.

  • ABOUT DATA SENDING IN idoc TO file SCENARIO

    How the data is sended in idoc to file scenario?
    what is the difference in sending data through BD10, BD14 and WE19 ?
    Is the data is sended through XI OR R/3 SYSTEM?

    Hi Rammohan
    >> How the data is sended in idoc to file scenario?
         Makeing settings in SAP R/3 side then based on the RFC
         destination,port,parterner profiles.....
         Idoc can hold the data with out any direction but RFC port will direct where to
        go ...based on the partner profiles (Out buond IDOCS)
    >>what is the difference in sending data through BD10, BD14 and WE19 ?
        BD10,BD11,BD12,BD13,BD14 will be to send the master data automatically
        generally will be in the production(But not for testing) and this will be depending
        on the declaration of profiles in the BD64
        --- But we19 will be used to test the Idocs with any data
            but here we need to give all the parameters like senders,receivers,ls,idoc...
    >>  Is the data is sended through XI OR R/3 SYSTEM?
         Data will send through XI  i.e XI will receive the Idoc and Convert into XI specific
         SOAP XML message and process all the pipe line steps ...based on the target
         it will send
         Here target is file so choose the file adapter as target and give all parameters
         it will work fine
    I hope this will answer your question
    regards
    --- prasad

  • Using LoadVars in SSAS to send data to a php file

    I am using FMS 4.5 and have a simple application which I want to use to send two strings to a php file. But I get a compilation error whenever I try to assign any value to these objects:
    Here is main.asc:
    <code>
    var variables = new LoadVars();
    variables.username = "uname";
    variables.send(http://url.abc.com/test.php,POST)
    </code>
    I can't compile with the second line. FMS just says: Sending error message: Compilation error
    How do I send variables to a HTTP URL?

    However that should be fine..
    This is sample way to send data using LoadVars
    var my_lv = new LoadVars();
    my_lv.name= "myname";
    my_lv.send("http://server/test.php", "_blank", "POST");
    Try keeping url and and POST method within "quotes". Also, method [POST/GET] is third parameter, second is target where results must be loaded (if any)..

  • I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sending data to Message borker.(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to save file in SAP fold

    I have a scenario,  ECC-PI-Message broker. ECC sending IDOC to  PI, PI execute mapping and  sends data to Message borker(thru JMS channel).(with almost one to one mapping)., IDOC(AAE)-PI-JMS. Now my requirement is., from PI  after mapping we need to create file with same data what ever send to Message broker and put the file in SAP folder without touching mapping. Is it possible? Please advise with the steps. We are using the ICO for this senario. Quick response is appriciated.

    Hi Pratik,
         http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true
    This link might help.
    regards
    Anupam

  • What is the Maximum Data can a file adapter can send at a time.

    Hi ,
    What is the Maximum Data can a file adapter can send at a time.Is there any maximum limit data can adapters will send.
    can any one help on this.
    regrads
    Raghu

    Hi Reddy,
    I have raised the same question and I got correct answer.
    Refer the below thread which will give u information.
    Wat is the maximu size of data XI can handle
    Thnx
    Chirag

  • Form message pops up "Sending Data files by Email" when it shouldn't

    I have a simple PDF with a form which I've created with the form tools in Acrobat Pro 8 for sending a FDF file by email.
    It works OK but when clicking on some of the other internal page links in the document (set up in InDesign) that are entirely unrelated to the form I get the following pop up box:
    Sending Data files by Email
    Please note this form contains an email submit button. Clicking this button will email a data file containing data you type into the form. However, the form itself will not be sent. Remember you cannot save a completed copy of this form with Adobe Acrobat Reader 9.
    1. How do I stop this popping up. Especially on pages that are unrelated to the form.
    2. Why does it say: "Remember you cannot save a completed copy of this form with Adobe Acrobat Reader 9. " when it does seem to work OK. I can send the FDF file to an email address. But this pop up box just isn't right.
    And I have another query which isn't really on topic.
    3. How do you get radio buttons to be mutually exclusive (eg: sex: male/female) - it says in the Radio Button Properties button Options tab to get them to have the same field name. But where do you set the field name?
    I posted this in the Mac section as I think the Mac version of Acrobat Pro may be the route cause!

    1. How do I stop this popping up. Especially on pages that are unrelated to the form.
    I do not know you can. It is a user setting, not a pdf file setting.
    2. Why does it say: "Remember you cannot save a completed copy of this form with Adobe Acrobat Reader 9. " when it does seem to work OK. I can send the FDF file to an email address. But this pop up box just isn't right.
    It is correct. The user cannot save the file which is a pdf file. It is not sending you a pdf file, but as you noted a fdf file.
    3. How do you get radio buttons to be mutually exclusive (eg: sex: male/female) - it says in the Radio Button Properties button Options tab to get them to have the same field name. But where do you set the field name?
    If you double-click on any field with the field tool activated, you will get the field properties box. You can set the field name and default value here. You want the field name to be the same, but the default value to be different.

  • Disable "Send Data File" prompt

    When I open the pdf created in LiveCycle Designer 7.1 and click on "Submit to Email" it prompts me for what type of email app I use. It then presents the "Send Data File" prompt. The options are "Send Data File" "Print Form" and "Cancel." It also has a "Don't show again" checkbox.
    Is there a way to disable this prompt? For example after the user clicks on their email app it would simply open the email with the data file as an attachment.
    I'm afraid that my people may click on "Print Form" instead of "Send Data File" or they might click "Cancel". I just want to ensure this is as easy as possible for them to complete.
    Does anyone know if it's possible to disable the "Send Data File" prompt and automatically open an email and attach the data file?

    Amrit,
    I apologize for taking so long to respond to your question. It took me a while to locate someone on the Acrobat Team who could answer my questions.
    It's a good thing you asked about this because it turns out that this behaviour will no longer occur as of the next release of Acrobat. In the next release, if the call to submit a form's data via email comes from an Acrobat
    Action, the "Choose your email application" dialog will always be displayed (unless the user has already clicked on the "don't show this again" check box which you can't control programmatically). If, however, the call to submit the form's data comes from JavaScript, the dialog won't be displayed. Instead, Acrobat will use the system's default email application (e.g. Microsoft Outlook) to do the submission.
    Unfortunately, clicking on a button with the mouse or the keyboard (by setting focus to it and hitting the Enter key) as well as firing a button's Click event with execEvent("click"), as I had previously suggested, will all be considered Acrobat
    Actions and will therefore possibly show the unwanted "Choose your email application" dialog.
    In order to get around this, we need a solution which always uses JavaScript to do the submission. Fortunately, we can use the Acrobat Document object's
    submitForm method to do this, thereby ensuring that the unwanted dialog doesn't show-up in future versions of Acrobat. The only potential problem with this solution is that it'll only work if the form is rendered to PDF. If the form is rendered to HTML (using
    Adobe LiveCycle Forms, for example), this method will not work because Acrobat won't be involved in hosting the form.
    The trick is to use the
    event.target object in a regular button's Click event. This object is actually the Acrobat Document object. From there, you can use the
    submitForm method as follows in order to achieve the same behaviour as that of Designer's email submit button (in JavaScript):
    var sEmailAddress = "[email protected]";
    var sSubject = "This is an email";
    event.target.submitForm
      cURL: "mailto:" + sEmailAddress + "?subject=" + sSubject,
      cSubmitAs: "XML",
    I've attached a sample form which uses this JavaScript to submit its data via email. Give it a try to see how it works.
    Stefan
    Adobe Systems

  • How do I send measurement data to a file during sampling and not after?

    Hi there, I am new to LabView and am in need of some help. I am acquiring temperature data which I am send to a LVM file at the end of the program. Is there a way to have my data recorded after each measurement (or periodically during the measurements if writing to a file every time will slow it down?)? I just wanted to ensure that if I am running the program for long periods of time that I will have some data stored in the case that the computer crashes, etc. and that I won't lose everything.
    Any suggestions are appreciated!

    Hi,
    Of course, you can open a file before the measurement starts and keep on pumping the data in to the file and close the same after the measurement finishes. But you have to take care of the criteria like sampling rate and the number of samples each time you are acquiring so that there is no chance to loose our program speed and CPU usage.
    MRK (CLAD)

  • HOW CAN U CORRECT THE DATA IN UR FILE WHICH CONTAINS 1 LAKSH RECS

    Hai Frnds,
    i Attend an interview they asked this questions can u know the answeres . tell me .
    In File to file scenario how can we reprocess records which failed records.
    HOW CAN U CORRECT THE DATA IN UR FILE WHICH CONTAINS 1 LAKSH RECS
    Thanks in advance
    thahir

    Hi,
    Refer these links:
    this might help you
    Generic Approach for Validating Incoming Flat File in SAP XI - Part 1
    Generic Approach for Validating Incoming Flat File in SAP XI - Part 1
    validating against schema file for the output XML file
    Informing the sender about bad records
    Regards,
    Nithiyanandam

Maybe you are looking for

  • How to find out who deleted the archive logs

    Hi All, Recently some archive logs were deleted from one of our servers. Is there any way to find out which user has deleted the archive logs through OS or through database ? OS Version :- SunOS Generic_Virtual sun4u sparc SUNW,SPARC-Enterprise Datab

  • Communication channel - Variable Substitution error,.

    Hi, I am having the following mesage type used in messag emapping as a target structure mt_data    -> Variable1 I am having a validation on mt_data node in message mapping for generating it, if condition is satisfied mt_data will be generetaed. Under

  • Organisational Structure replications

    Hi, Does anyone have a best practice guide or something as to the best methods for managing oranisational replications from ECC to SRM. Over the years I have encountered many of the same issues such as users becoming detached and muliple business par

  • My Bad Experience with Time Machine

    First, I would like to start by saying that I am not an advanced Mac user. I just so happened to stumble upon the solution using google. (The best form of tech support). The short version of this is if you are restoring from Time Machine DO NOT Drag-

  • Itunes folders missing 411

    When I open an itunes library all of the music is there. However, when I select the same library folder from the HD and open an individual artist's folder, only some of the artist's various album's folders are there. Why is this?