Dynamic Creation of .txt file

hi Friends ,
I want to create .txt file from oracle database information on apache tomcat server side.
or
create .txt file when user give some input according to that data should be retrival from oracle table.

Start reading the following tutorials:
JDBC: [http://java.sun.com/docs/books/tutorial/jdbc/index.html]
IO: [http://java.sun.com/docs/books/tutorial/essential/io/]
If you stucks with this, please ask a specific technical coding problem instead of just stating a global requirement.

Similar Messages

  • How can I load a .TXT file into a dynamic text box?

    I am sure that many people know how to load a .txt file into
    a dynamic text box. But I do not. I want to be able to reference a
    txt file from the server into the text box. So that when I change
    the text file it changes in the flash movie without even editing
    the flash file itself. Thank you.

    http://www.oman3d.com/tutorials/flash/loading_external_text_bc/
    I think this is the simplest way to go :)

  • Txt file creation

    Hi everyone,
    I need your help.
    There are many threads on txt creation in that forum but I couldn't find the one that answers to my questions.
    I'd like to create a txt containing one Header (FILE EDITOR, Time and Date) and  ten columns of data. Every column should be preceded (on top) by the words COLUMN1 to COLUMN10.
    The created file should also contain the time and date of creation.
    Please see the attached files.
    Best regards
    Kabanga
    Attachments:
    Write_file.vi ‏44 KB
    data.txt ‏2 KB

    Hi guys,
    Thanks for your help!
    I did the modifications you advised me. It's working well:
    Now I'd like the following: If make "SAVE" for the same file three times, I'd like it to be like in the attached txt file (data):
    How can I implement it?  I've  tried it with "Set File Position" but it's not working.
    Best regards
    Kabanga
    Attachments:
    data.txt ‏4 KB
    Write_file.vi ‏52 KB

  • Dynamic Text with external .txt files

    I need help getting dynamic text to display. I've used the
    following tutorials (among others).
    http://www.kirupa.com/developer/mx/dynamic_scroller.htm
    http://www.kirupa.com/developer/mx/multiple_dynamictext.htm
    In Flash 8 on last frame of maintimeline of movie, I have a
    layer with a background image, 2 buttons and a dynamic textbox
    (made scrollable) with scrollbar component. Textbox is given a var
    of "content", and an instance name of "textBox", which is
    referenced in scrollbar parameters.
    I have created 3 text .txt files, and saved them to same
    folder with movie .swf file. Text in files is preceeded by
    "content=" on line preceeding text to correspond with var of
    dynamic textbox. The files were created in Rich text format on Mac
    OSX4.11 and saved with .rtf extension, then file extension was
    changed to .txt (wouldn't save as .txt)
    I've added the following actionscript to this last frame:
    loadText = new LoadVars();
    loadText.load("TEXTintro.txt");
    //creating the loadVarsText function
    loadText.onLoad = function(success){
    if (success){
    textBox.text = this.content;
    else{
    trace("Error loading external content");
    Buttons have an instance name assigned with the following
    actionscript:
    on (release) {
    loadText = new LoadVars();
    loadText.load("TEXT1.txt");
    loadText.onLoad = function(success){
    if (success){
    textBox.text = this.content;
    else{
    trace("Error loading external content");
    When I test movie, I can see buttons on last frame of movie,
    but they don't load any text when pressed, and "undefined" text
    appears in upper left corner of text box before I press either
    button.
    I am getting the following Output errors:
    **Error** Scene=MoonOfWintertime, layer=TextBox,
    frame=2500:Line 1: Statement block must be terminated by '}'
    on (release) {
    **Error** Scene=MoonOfWintertime, layer=TextBox,
    frame=2500:Line 11: Syntax error.
    **Error** Scene=MoonOfWintertime, layer=TextBox,
    frame=2500:Line 1: Statement block must be terminated by '}'
    on (release) {
    **Error** Scene=MoonOfWintertime, layer=TextBox,
    frame=2500:Line 11: Syntax error.
    Total ActionScript Errors: 4 Reported Errors: 4

    No more output errors, buttons still not working, but I got
    my intro .txt file to load in textbox that loads with frame using
    the following code I tried from another tutorial:
    loadText = new LoadVars();
    loadText.onLoad = function() {
    textBox.html=true;
    textBox.htmlText = this.textContent;
    loadText.load("TEXTintro.txt");
    Tried the following code with buttons, but doesn't work.
    Other code suggestions?
    on (release) {
    loadText = new LoadVars();
    loadText.onLoad = function() {
    loadText.load("TEXT2.txt");
    on (release) {
    loadText = new LoadVars();
    loadText.onLoad = function() {
    textBox.html=true;
    textBox.htmlText = this.textContent;
    loadText.load("TEXT1.txt");
    }

  • Cache creation hang on .txt file

    I have 50+ sites defined.
    This one directory hangs on site cache creation and
    dreamweaver never gets past any file.
    I thought it might have been a specific file, and have
    removed one after another to discover it doesn't care what the file
    is, it just fails to create a site on this directory, or anything
    containing this directory.
    I have checked permissions and am stumped by this.
    Any ideas?

    Hi guys,
    Thanks for your help!
    I did the modifications you advised me. It's working well:
    Now I'd like the following: If make "SAVE" for the same file three times, I'd like it to be like in the attached txt file (data):
    How can I implement it?  I've  tried it with "Set File Position" but it's not working.
    Best regards
    Kabanga
    Attachments:
    data.txt ‏4 KB
    Write_file.vi ‏52 KB

  • How to check on-thy-fly dynamic txt-files

    hello.
    i want to check out a dynamic txt-file (dynamic, because it is a running log from a chat) for specific words.
    the program should start to check the incoming content at the actual end of the file(previous content is in this case uninteresting) and shouldn't stop to do that(unless i want it).
    my problem is, that the program stops after it reachs the end of the file.
    any idea?
    many thx.
    try
              String zeile;
    //Wir lesen aus "eingabe.txt".
              File eingabeDatei = new File(new URI("file:///C:/Log.txt"));
    FileReader eingabeStrom = new FileReader(eingabeDatei);
    BufferedReader eingabe = new BufferedReader(eingabeStrom);
    while ((zeile = eingabe.readLine()) != null)
         Pattern p = Pattern.compile("TESTWORD");
    // Muster: Ziffer, mind. ein Buchstabe, Ziffer
    Matcher m = p.matcher(zeile);
    if (m.find())
         Robot rob = new Robot();
         rob.keyPress( '1' );
    System.out.println (m.group());
         System.out.println("Pattern at Pos. " + m.start());
    System.out.println("Pattern is: " + m.group());
    else
    System.out.println("***No pattern found***");
    //System.out.println(zeile);
    } catch (IOException e)
    e.printStackTrace();
    }

    hello.
    i want to check out a dynamic txt-file (dynamic,
    because it is a running log from a chat) for specific
    words.
    the program should start to check the incoming
    content at the actual end of the file(previous
    content is in this case uninteresting) and shouldn't
    stop to do that(unless i want it).
    my problem is, that the program stops after it reachs
    the end of the file.
    any idea?
    many thx.
    Please use the code tag next time you post code. Thanks.
    (see more comments below)
    try {
         String zeile;
         //Wir lesen aus "eingabe.txt".
         File eingabeDatei = new File(new URI("file:///C:/Log.txt"));
         FileReader eingabeStrom = new FileReader(eingabeDatei);
         BufferedReader eingabe = new BufferedReader(eingabeStrom);
         while ((zeile = eingabe.readLine()) != null)
              Pattern p = Pattern.compile("TESTWORD");
              // Muster: Ziffer, mind. ein Buchstabe, Ziffer
              Matcher m = p.matcher(zeile);
              if (m.find())
                   Robot rob = new Robot();
                   rob.keyPress( '1' );
                   System.out.println (m.group());
                   System.out.println("Pattern at Pos. " + m.start());
                   System.out.println("Pattern is: " + m.group());
              else
                   System.out.println("***No pattern found***");
              //System.out.println(zeile);
    catch (IOException e) {
         e.printStackTrace();
    }The line:
    while ((zeile = eingabe.readLine()) != null)is why your app quits. The while loop ends on null which happens when there is nothing to read from the reader
    From the API:
    Returns:
    A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached.

  • How to check whether there r new txt files in a folder n file creation date

    How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?

    Hi
    I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
    Cheers!
    Shailesh

  • Reg : txt Files in Server directory (UTL_FILE)

    Hi Experts,
    Suppose, I've placed 5 +.txt+ files (procedure/table creation scripts) in a db server directory.
    Is there any way I can loop through each of the files?
    I need to pull the content of each file into oracle table using a procedure. So, I'm trying dynamically trying to use External Tables with Execute Immediate inside my proc. Will package UTL_FILE help in this?
    Please give some suggestions.
    Let me know if you have any concerns.
    Ranit B.

    As an alternative solution, have you considered using external LOB's? Using this approach could save significant overhead vs. the external tables solution because it doesn't require any schema objects for accessing the txt files (if you use an SQL script instead of a stored procedure).
    http://docs.oracle.com/cd/B14117_01/appdev.101/b10796/adlob_bf.htm#1010878
    Below is an excerpt from the link the Oracle docs above; this could be used as a starting point. (Substitute your directory name/file name for the BFILENAME arguments.)
    /* This file is installed in the following path when you install */
    /* the database: $ORACLE_HOME/rdbms/demo/lobs/plsql/fdisplay.sql */
    /* Displaying BFILE data.  */
    /* Procedure displayBFILE_proc is not part of DBMS_LOB package: */
    CREATE OR REPLACE PROCEDURE displayBFILE_proc IS
       file_loc BFILE := BFILENAME('MEDIA_DIR', 'monitor_3060.txt');
       Buffer   RAW(1024);
       Amount   BINARY_INTEGER := 200;
       Position INTEGER        := 1;
    BEGIN
       DBMS_OUTPUT.PUT_LINE('------------ BFILE DISPLAY EXAMPLE ------------');
       /* Opening the BFILE: */
       DBMS_LOB.OPEN (file_loc, DBMS_LOB.LOB_READONLY);
       LOOP
          DBMS_LOB.READ (file_loc, Amount, Position, Buffer);
          /* Display the buffer contents: */
          DBMS_OUTPUT.PUT_LINE(substr(utl_raw.cast_to_varchar2(Buffer), 1, 250));
          Position := Position + Amount;
       END LOOP;
       /* Closing the BFILE: */
       DBMS_LOB.CLOSE (file_loc);
       EXCEPTION
       WHEN NO_DATA_FOUND THEN
          DBMS_OUTPUT.PUT_LINE('End of data');
    END;
    SHOW ERRORS;

  • Dynamic creation of internal table based on alv layout

    Hi experts!!
    I have the following request from my client:
    I am displaying an alv report and i need to download it in txt format based on the columns showed in the current layout (i.e. if the user chooses to hide some columns, then they should not appear in the txt file ). In the alv i am using the Function Modules of the alv and not ABAP Objects.
    I thought of dynamically creating the internal table, but i am not sure how to do it.
    I also thaught of creating an internal table with only one field with the maximum length, but how can i check which fields are diplayed, and how can i get their values??
    Please Help!!
    Thank u in advance!!!
    Please - no duplicate posts
    Edited by: Rob Burbank on Feb 24, 2009 2:16 PM

    After call the above said function module you will get the exporting table for field catalog ie
              call function 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
                importing
                  es_layout     = ls_slis_layo
                  et_fieldcat   = lt_slis_fcat
    if you check the lt_slis_fcat internal table if the field are hide in the layout by the user then in this internal table check for field NO_OUT will X.
    Take the fields where NO_OUT ne X 
    then for creating dynamic internal table
      field-symbols :  <ptab>  type standard table.
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog =  lt_slis_fcat
        importing
          ep_table        = i_content.
      if sy-subrc = 0.
        assign i_content->* to <ptab>.
      else.
        write: 'Error creating internal table'.
        stop.
      endif.
    Here  is the dynamic internal table

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Reading .txt file on Windows Server 2008

    I have a Java 7 application that we distribute, and it reads configurations from a .txt file distributed with it, in the same directory as the .jar file. On Windows 7, windows XP, Windows 8, this works fine, but on our server, running Windows Server 2008, this fails. It is a simple check that fails:
    Path p = Paths.get("config.txt");
    if(Files.isReadable(p))
    This will not work on Windows Server 2008 r2. It suspect that it somehow hasn't got read permissions, but I'm not sure.
    It also fails if the absolute path is specified.

    And what if you use the regular old fashioned standard IO File class and not Files to check if the file is readable (File.canRead())?
    Methinks (or to be honest: I guess) there is something odd with the creation of the Path object on your windows server file system, but I wouldn't be able to tell what exactly.

  • [CS3 JS]  Reading TXT file content into String

    Hello,
    I'm currently wanting to display a dialog box that has a dropdown menu containing all countries of the world.
    I have an external txt file that contains a list of all countries.
    I thought I would simply read-in the contents of the 'txt' file into a string and use it for displaying the list.
    For example
    i Instead of the usual:
    > var myLandMenu = dropdowns.add({stringList:["A", "B"...], selectedIndex:0});
    i I thought of doing something like:
    > var myLandList = ....? HELP ?....
    > var myLandMenu = dropdowns.add({stringList:myLandList, selectedIndex:0});
    Is this the way to do it?
    What would be the way to read in the text file content as a string?
    Thanks in advance,
    Lee

    > var myLandList = ....? HELP ?....
    > var myLandMenu = dropdowns.add({stringList:myLandList, selectedIndex:0});
    It's hard to tell from context, but myLandList needs to be an array of strings.
    If the file has one element per line, this would be one way of handling the
    conversion:
    var file = File("~/countries.txt");
    file.open("r");
    var str = file.read();
    file.close();
    var myLandList = str.split(/[\r\n]+/);
    And assuming that this is ScriptUI and not the older ID UI, the menu creation
    would look more like:
    var myLandMenu = dropdowns.add(bounds, myLandList);
    myLandMenu.items[0].selected = true;
    -X
    for photoshop scripting solutions of all sorts
    contact: [email protected]

  • Convert .txt file to .pdf using java code

    Hi,
    My requirement is to read the .txt file and convert it into .pdf file after changing certain text.
    Searched the net got a document on iText ..is it the only way for conversion or any other method....please help.
    Thanks in advance.
    Pooja

    Hi.
    You could review this [url|http://www.roseindia.net/java/java-conversion/TextToPDF.shtml].
    It is a good example to use the iText Library.
    The other option could be [PDFBox|http://pdfbox.apache.org/].
    Here some [example code|http://pdfbox.apache.org/userguide/cookbook/creation.html#HelloWorld].
    Another option, but more complicated is [Apache FOP|http://xmlgraphics.apache.org/fop/].
    I hope you can find the right solution.
    Kindest regards, have a great day

  • Updated record should come in txt file

    Hi Friends,
    My requirements like this way, any changes make in mara, mard, mbew, makt, vbak, vbap, vbrk and abrp table. that newly created data should come in .txt file of application server.
    I have already developed a program for that. it is downloading data in every 3 hours slots. it is running in background. whatever changes made during these hours it will download.
    now, my requirement has been changed, instance data should come in .txt file of app server. e.g. when newly created record save in database table, same time that record should come in .txt file with proper format.
    is it possible? please let me know.
    Thanks in advance,
    Parag

    Hi Parag,
    To obtain changes you know you can get the details from the tables CDHDR and CDPOS.
    Also you have questions about performance and so. SO here are some details.
    - When you flag a data element for change document (is checked) it is ONLY a marker that allows for registration of this field's changes into CDHDR and CDPOS. The actual control is done on datafile level in its technical settings (Transaction SE11 with datafile name and then push button "Technical Settings" or CtrlShiftF9). Herein you will find a flag "Log data changes".
    Within the CDHDR file and CDPOS file a field OBJECTCLAS is used. Only for existing OBJECTCLAS values the changes are logged.
    - Now obvious this is the trick for standard SAP (as Subramanian has already pointed out you can find "OBJECTCLAS" values with transaction SCDO). If you want to know on how to create your own "OBJECTCLAS" values with working logging on your own designed fields follow Subramanian suggestion and read the documentation.
    Now to your questions:
    You gave some tables you need to track changes (and now also for initial creation) like MARA, MARD, MAKT and others.
    To get changes for these tables use the following "OBJECTCLAS" values:
    - MATERIAL (Tables MARA, MARC, MARD, MBEW, MFHM, MLGN, MLGT, MPGD, MPOP and MVKE). By-the-way, this object will be replaced by MATERIAL_N  (available from release 4.6x).
    - VERKBELEG (Tables VBAK, VBAP, VBEP, VBKD, VBLB, VBPA, VBPA2 and VBUK).
    To collect changes (suggested by Andreas) you could use function module CHANGEDOCUMENT_READ. This is very usefull if also archiving is active for the objects you need to track changes for and your changes are scattered through time, but for your problem it is better to approach the log data directly.
    1. First select the main change documents from CDHDR table for a given "OBJECTCLAS" and "OBJECTID". Here you can use additional filtering on DATE (field UDATE) and TIME (field (UTIME). Even filtering on a specific transaction is possible (field TCODE).
    This gives you a number of change documents (field CHANGENR).
    2a. Secondly select the specific field changes from table CDPOS by using the found fields from CDHDR and additionally fill TABNAME with the specific table and if required FNAME with the specific field name. 2b. Since in your case the values will not be known, you need to track changes, you have to be very carefull in your selections. If you track the object MATERIAL or MATERIAL_N, you best loop over the MARA table and for each MATNR fill the OBJECTID field of CDHDR with this MATNR value.
    3. In order to find NEWLY created items you need to check the CHANGE_IND flag. When 'I' it is an new insert, when 'U' it is an update. Now this rule applies ONLY to key fields, since SAP first creates the key record (CHANGE_IND = 'I') and then the other fields (CHANGE_IND = 'U').
    Finally the warning given by Andreas (runtime increases - you MUST select with OBJECTCLAS and OBJECTID) is very important. Not supplying OBJECTID will have a very heavy impact on the runtime.
    Hope this gives you some clues on how to approach your problem.
    Regards,
    Rob.

  • Dynamic generation of jnlp file

    I'm dynamically generating a jnlp file using a jsp to pass run-time parameters over to my Java application thusly:
    <%
    response.setContentType("application/x-java-jnlp-file");
    String userName = request.getParameter("username");
    String password = request.getParameter("password");
    String batchId = request.getParameter("batchid");
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    out.println("<jnlp ");
    out.println("spec=\"1.0+\" ");
    out.println("codebase=\"http://server/directory\" ");
    out.println("href=\"this jsp file\">");
    ... other jnlp stuff...
    out.println("<application-desc main-class=\"myApp.myClass\">");
    out.println("<argument>" + userName + "</argument>");
    out.println("<argument>" + password + "</argument>");
    out.println("<argument>" + batchId + "</argument>");
    out.println("</application-desc>");
    out.println("</jnlp>");
    And use args[] to attempt to get the passed parameters in the Java application:
    userName = args[0];
    password = args[1];
    batchId = args[2];
    However, they don't seem to be passed over to the application as I get NullPointerExceptions. If I try to trace the state of the arguments by adding:
    FileOutputStream f = new FileOutputStream("w:output.txt");
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(f, System.getProperty("file.encoding")));
    w.write("userName: " + userName);
    w.write("password: " + password);
    w.write("batchId: " + batchId);
    f.flush();
    f.close();
    The output file is completely empty.
    1. Am I passing the arguments in wrongly?
    2. Why is the output not being written in the file?
    My thanks in advance for any assistance offered.
    Erkton

    Erkton,
    I use a similar approach and it does work. The main gotchas I found were typos. I would suggest temporarily changing the
    response.setContentType("application/x-java-jnlp-file");
    line to
    response.setContentType("text/xml");
    and looking at your JNLP file as XML and verifything that you got everything write. Look for beginning and end tags, stuff like that.
    Once you have it right then switch it back to JNLP.
    One other thing to look out for is Internet Explorer doesn't like jnlp files unless they end with a .jnlp extension. I had to rename my jnlp files to end with .jnlp instead of .jsp for IE to parse them correctly. I don't think thats the issue you are running into, but you may want to look out for it.

Maybe you are looking for