Writing to A text file that is located on an online directory.

I have an application that several users will be using. The program outputs a string when a submit button is clicked. I have a txt file called Data.txt which resides on a web directory with the following url. http://nath5.hostrator.com/............/Data.txt I need some way to have the string that the program outputs to be appended to the txt file. I have talked to my computer science teacher and he wasn't really sure how to do this in java. I am still a beginner, so any help anyone can offer would be great.
Thanks Alot

Genrally speaking you can't "write" to any random HTTP URL. HTTP is primarily a read-only protocol (it has PUT and POST, but those are not widely used for directly writing to URLs).
You could use WebDAV (which is an extension of HTTP), if the server is set up to allow it.
Another common approach is to use ftp to access the files directly ('though you'd obviously need a ftp:// URL instead of a HTTP:// one).

Similar Messages

  • Downloading text file to ftp location

    Hi Everyone,
    Could you please guide me for the following query:
    I am trying to send the output of a sap program in a text file to ftp location. In that, while passing the following parameter the program is allowing me to download the file to ftp location:
    CALL FUNCTION 'FTP_CONNECT'
           EXPORTING
             user            = userid
             password        = password
             host            = 'IPADDRESS'
             rfc_destination = 'SAPFTP'
           IMPORTING
             handle          = mi_handle
           EXCEPTIONS
             not_connected   = 1
             OTHERS          = 2.
    Through this way i am able to download the file to ftp location(as per ipaddress).
    But when trying to download the file in a folder on the same ftp location it is not doing that.
    The parameters, which i am passing are described below:
    CALL FUNCTION 'FTP_CONNECT'
           EXPORTING
             user            = userid
             password        = password
             host            = 'IPADDRESS/Folder_Name'
             rfc_destination = 'SAPFTP'
           IMPORTING
             handle          = mi_handle
           EXCEPTIONS
             not_connected   = 1
             OTHERS          = 2.
    Please guide.
    Thanks and Regards

    Hi,
    While using CONNECT, we do not have to give the folder. It should only be the server / ip address.
    While using FTP_COPY, we can give the folder name in parameter FILE_DESTINATION.
    regards,
    amit m.

  • (Administration - Marketing - Import), you can set a parameter value "Import mode" for what to do in case of duplication as "update existing records", "Import new records". The final report of this import is presented as a text file that can be viewed in

    Administration - Marketing -> Import, you can set a parameter value "Import mode" for what to do in case of duplication as "update existing records", "Import new records". The final report of this import is presented as a text file that can be viewed in Business Administration - Marketing -> Import -> Exceptions. Whatever the exception, including duplication import occurs during import and recorded in a text file.   What are the fields that determine the duplicity? How I can I can change those?

    You will be returned anything that is in the option's value parameter. What is displayed in the dropdown and what is put in the value attribute do NOT need to be the same, so maybe you should start there.

  • I need to get the value of a text field that is located in another page JSP

    I need to get the value of a text field that is located in another page JSP. How do I do that?

    Well you see, I have a page at angelfire.com, which
    does not support JSP. I want to call a script located
    at mycgisever and then, when pressing a link on the
    former page, the JSP page is loaded, and the script
    get the value from the text field on the OTHER page.
    Is this possible?I know nothing about cgi. But that should not prevent me from understanding what can and cannot be done, assuming cgi is sort of comparable with jsps.
    I'm unable to understand your description clearly. Try to explain it better. Give precise steps that you intend to follow and I should be able to help you further.
    So you have a page1.
    You hit submit from page1.
    That goes to the cgiserver.
    From the cgiserver, programmatically load up the jsp.
    search this for the text field.
    Display it on your page2.
    Is that what you are trying to do?
    BTW, won't be able to help you with cgi scripting at all. Can help with Java and Jsp.

  • TextEdit - Plain Text Files That Open In Windows?

    Hi. Just got an iMac. I've been trying to make plain text files in TextEdit that show up correctly in Windows on a PC. I've tried saving the same document in 4 different formats:
    - Plan Text Unicode (UTF-8)
    - Plain Text Unicode (UTF-16)
    - Plain Text Western (Mac OS Roman)
    - Plain Text Western (Windows Latin 1)
    But none of these look right on a PC. All of the line breaks I've entered show up replaced by black rectangles. Why is this?
    What format should I save as in TextEdit, to create Plain Text files that are compatible with both PC and Macs?

    First, note that TextEdit does not create plain text files, it creates rich text files (.rtf). If you truly want plain text, try the free TextWrangler:
    http://www.barebones.com/
    As to the line break problem, Macs use just a carriage return as the end-of-line character, while Windows uses a carriage return followed by a line break character. At least, that's how I understand it. Most likely, whatever app you're using on Windows is dumb enough that it can't figure out what to do with the Mac line endings. TextWrangler will let you change the line breaks, so you could use it to create plain text files with Windows line breaks. Of course, that doesn't help if you didn't really want plain text (ie, absolutely no styling, just raw text).

  • What is the maximum number of 263 byte text files that can fit in a folder?

    what is the maximum number of 263 byte text files that can fit in a folder - on a windows 2000 operating system?
    I created a java program that creates these text files.
    It was set to loop 30,000 times.
    It created a total of 21874 html files before throwing a null exception.
    I tried to copy and paste 10 more html files manually and it said not enough disk space.
    however, I made a New Folder in that same folder and I was able to successfully paste the folders in
    there.
    That's interesting.
    It appears there is a size limit in each folder, BUT I can make another folder within that and successfully paste more html files in there
    Does anyone know the rules governing this feature.
    Stephen

    Whatever the answer is, it has nothing to do with Java programming. Microsoft might know, though, and that's where you should look.

  • Upload text file that uses "|" as separator

    Hello,
    Im trying to upload a text file that uses " | " to separate its columns using fm gui_upload, but it only uploads the first column.
    Could anybody tell me what other fm i can use or what i may be doing wrong?

    Use this.
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                      = lv_file
            filetype                      = 'ASC'
           <b> has_field_separator           = '|'</b>
            header_length                 = 0
            read_by_line                  = 'X'
       DAT_MODE                      = ' '
       CODEPAGE                      = ' '
            ignore_cerr                   = 'X'
            replacement                   = '#'
       CHECK_BOM                     = ' '
       VIRUS_SCAN_PROFILE            =
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       HEADER                        =
          TABLES
            data_tab                      = data_mat
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    Reward Points if useful.
    Thanks
    Aneesh.

  • What are the text files that suddenly showed up in the Preferences folder?

    I just noticed a group of text files in the Preferences folder that I haven't noticed before. All of them were created within a 3-minute period on 12/31/2008. The names are in sets of 4 or 5 that follow this scheme:
    np_334572current
    np_334572services
    np_334572servicesnew
    np_334572sets
    np_334572system
    The default app to open these is Property List Editor.
    They haven't been modified since they were created, even though I've been adding, deleting, and modifying apps and their preferences since then. Anybody know what they are? Can or should I delete these?
    Thanks in advance.

    Dick,
    To be honest I don't know what program they are related to. However If the files are located in ~/Library/Preferences (Where is ~ = your home directory) Then You should be safe in moving/deleting them, at worst you will have to reset the settings in one of your apps. What that folder is mainly used for is say for example you have your dock show/hide it self. That will be saved to a plist file in the preferences folder. If you delete or move the dock's plist out of there your dock on your next login will go back to the default view of Mac OS.
    Now To be honest you don't have to move/delete those files that are there, especially since at most you will probably reset some of the preferences you set in an application. But its up to you. Also you could always move it first to see what app it is and either move it back or delete it later.
    Hope that helps,
    Weston

  • High Score Table: Writing a Simple Text File with Flash and PHP

    I am having a problem getting Flash to work with PHP as I need Flash to read and write to a text file on a server to store simple name/score data for a games hi score table. I can read from the text file into Flash easily enough but also need to write to the file when a new high score is reached, so I need to use PHP to do that. I can send the data from flash to the php file via POST but so far it is not working. The PHP file is confirmed as working as I added an echo to the file which displayed a message so I  could check that the server was running PHP - the files were also uploaded to a remote server so I  could test them properly. Flash code is as follows:
    //php filewriter
    var myLV = new LoadVars();
    function sendData() {
    //sets up variable 'hsdata' to send to php
    myLV.hsdata = myText;
    myLV.send("hiscores.php");
    I believe this sends the variable 'myText' to the php file as a variable called 'hsdata' which I want the php file to write into a text file. The mytext variable is just a long string that has all the scores and names in the hiscore. OK, XML would be better way of doing this but for speed I just want to get basic functionality working, so storing a simple text sting is adequate for now. The PHP code that reads the Flash 'hsdata' variable and writes it to the text file 'scores.txt' follows:
    <?php
    //assigns to variable the data POSTed from flash
    $flashdata = $_POST["hsdata"];
    //file handler opens file and erases all contents with w arg
    $fh = fopen("scores.txt","w");
    //adds data to file
    fwrite ($fh,$flashdata);
    //closes file
    fclose ($fh);
    echo 'php file is working';
    ?>
    Any help with this would be greatly appreciated - once I can get php to write simple text files I should be ok. Thanks.

    Thanks for your help.
    I have got Flash working to a certain extent with PHP using loadVars but have been unable to get flash to receive a variable declared in PHP. Here's my Flash code:
    var outLV = new LoadVars();
    var inLV = new LoadVars();
    function sendData() {
    outLV.hsdata = "Hello from Flash";
    outLV.sendAndLoad("http://www.mysite.com/hiscores/test23.php",inLV,"post");
    inLV.onLoad = function(success) {
    if (success) {
      //sets dynamic text box to show variable sent from php
      statusTxt.text = phpmess;
    } else {
      statusTxt.text = "No Data Received";
    This works ok and the inLV.onLoad function reports that it is receiving data but does not display the variable received from PHP. The PHP file is like this:
    <?php
    $mytxt =$_POST['hsdata'];
    $myfile = "test23.txt";
    $fh = fopen($myfile,'w');
    //adds data to file
    fwrite($fh, $mytxt);
    //closes file
    fclose ($fh);
    $mess = "hello there from php";
    echo ("&phpmess=$mess&");
    ?>
    The PHP file is correctly receiving the hsdata from flash and writing it to a text file, but there seems to be a problem with the final part of the code which is intended to send a variable called 'phpmess' back to Flash, this is the string "hello there from php". How do I set up Flash and PHP so that PHP can send a variable back to Flash using echo? Really have tried everything but am totally baffled. Online tutorials have given numerous different syntax configurations for how the PHP file should be written which has really confused me - any help would be greatly appreciated.

  • Writing records to text file

    Hi. I have a query that retrieves data in a table. however when writing into text file, I have some troubles aligning the records.
    In below example, how would align the data against its header?? thanks!
    As you see my data below is messed up =(
    Ex.
    Reference No. Name Phone No.
    012-066-121127-00227 MARIE LIM JOSEPH     2921786     
    013-318-130222-04992 NANCY SMITH     0170005486

    989873 wrote:
    Hi. I have a query that retrieves data in a table. however when writing into text file, I have some troubles aligning the records.
    In below example, how would align the data against its header?? thanks!
    As you see my data below is messed up =(
    Ex.
    Reference No. Name Phone No.
    012-066-121127-00227 MARIE LIM JOSEPH     2921786     
    013-318-130222-04992 NANCY SMITH     0170005486you need to fix your code;
    consider using LPAD or RPAD as appropriate

  • Writing from a text file into a table

    Hi,
    I have a problem with dearchiving the data from the txt file to the respective table.
    The table name is dynamic & I get the required columns from all_tab_columns.
    I use UTL_FILE.GET_LINE() to get the data one line at a time and INSTR() & SUBSTR() to break them into the respective columns.
    My dynamic insert contains a set of bind variables equal to the no. of columns of the table.
    The statement gets constructed correctly but I tried to use execute_immediate , i realised that i cannot construct the USING clause for it & hence I switced to DBMS_SQL.
    The DBMS_SQL.BIND_VARIABLE() binds all of the bind variables to a table of varchar2. I've taken care to convert the date & the number variables while binding.
    When i do DBMS_SQL.EXECUTE() I get the error,
    ORA-01008 Not all variables bound .
    I don't know the reason since the no. of bind variables & the no. of table variables are the same & the value in the table looks fine too!
    Could this be a date issue ??? am using the default format DD-MON-YY both to write to the text file and to read from it.
    Any help would be appreciated.
    thx
    kalpana
    Part of the code :
    Begin
    destination_file := upper(p_table_name)||'_ARCH'||to_char
    (p_process_date,'yyyymmdd')||'.dat';
    dbms_output.put_line(destination_file);
    file_id := UTL_FILE.FOPEN(file_path, destination_file,'r');
    -- Get the number of columns in the table to be archived
    select count(column_name)
    into col_ctr
    from all_tab_columns
    where table_name = upper(p_table_name)
    order by column_name;
    sql_stmt1 := 'Insert into '||p_table_name||'(';
    sql_stmt2 := ' values(';
    For col_rec in column_cur loop
    if col_ctr = column_cur%rowcount then -- last column in
    the select statement
    sql_stmt1 := sql_stmt1 || col_rec.column_name;
    sql_stmt2 := sql_stmt2||':b'||column_cur%rowcount;
    else
    sql_stmt1 := sql_stmt1 || col_rec.column_name ||',';
    sql_stmt2 := sql_stmt2||':b'||column_currowcount||',';
    end if;
    type_rec(column_cur%rowcount) := col_rec.data_type;
    end loop;
    sql_stmt1 := sql_stmt1||')';
    sql_stmt2 := sql_stmt2||')';
    sql_stmt := sql_stmt1||sql_stmt2;
    loop
    Begin
    UTL_FILE.GET_LINE(file_id,v_column_value);
    For i in 1..col_ctr loop
    v_next_position := INSTR(v_column_value,';',1,i);
    if i = 1 then
    v_rec(i) := SUBSTR(v_column_value, v_prev_position, v_next_position - 1);
    elsif i = col_ctr then -- last but one column
    v_rec(i) := SUBSTR(v_column_value, v_prev_position);
    else
    v_rec(i) := SUBSTR(v_column_value, v_prev_position, (v_next_position - v_prev_position));
    end if;
    v_prev_position := v_next_position + 1;
    end loop;
    v_cursor := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(v_cursor, sql_stmt, dbms_sql.native);
    For i in 1..col_ctr loop
    if type_rec(i) = 'DATE' then
    DBMS_SQL.BIND_VARIABLE(v_cursor,':b'||i, to_date(v_rec(i),'DD-MON-YY'));
    elsif type_rec(i) = 'NUMBER' then
    DBMS_SQL.BIND_VARIABLE(v_cursor,':b'||i, to_number(v_rec(i)));
    end if;
    end loop;
    -- Insert the row into the history table
    -- execute immediate sql_stmt USING value(v_rec);
    v_dummy := DBMS_SQL.EXECUTE(v_cursor);
    if SQL%NOTFOUND then
    dbms_output.put_line('CPN_HISTORY_ARCHIVE_PKG.DEARCHIVE_DATA : No records to insert');
    end if;
    Exception -- for UTL_FILE.GET_LINE
    when NO_DATA_FOUND then
    DBMS_SQL.CLOSE_CURSOR(v_cursor);
    UTL_FILE.FCLOSE(file_id);
    exit;
    End;
    end loop; -- end of loop for UTL_FILE.GET_LINE
    DBMS_SQL.CLOSE_CURSOR(v_cursor);
    UTL_FILE.FCLOSE(file_id);

    your program is currect except u r not building bind variables for varchar2 columns
    declare
    type tab133 is table of varchar2(4000) index by binary_integer;
    file_id utl_file.file_type;
    sql_stmt1 varchar2(1000);
    sql_stmt2 varchar2(1000);
    v_column_value varchar2(1000);
    sql_stmt varchar2(2000);
    col_ctr number:=0;
    p_table_name varchar2(30):='emp1';
    cursor column_cur is select column_name,data_type from user_tab_columns
    where table_name=upper(p_table_name);
    mainstr      VARCHAR2(40)          :=      '';
    splitstr      VARCHAR2(30)          :=     '';
    l_count      NUMBER(20)          :=     1;
    itr_count      NUMBER(20)          :=     0;
    processed      BOOLEAN               :=     FALSE;
    v_rec tab133;
    type_rec tab133;
    v_cursor integer;
    column_currowcount number;
    v_dummy number:=0;
    Begin
    --dbms_output.put_line(destination_file);
    file_id := UTL_FILE.FOPEN('c:\suresh', 'emp.txt','r');
    -- Get the number of columns in the table to be archived
    select count(column_name)
    into col_ctr
    from user_tab_columns
    where table_name = upper(p_table_name)
    order by column_name;
    sql_stmt1 := 'Insert into '||p_table_name||'(';
    sql_stmt2 := ' values(';
    For col_rec in column_cur loop
    if col_ctr = column_cur%rowcount then
    sql_stmt1 := sql_stmt1 || col_rec.column_name;
    sql_stmt2 := sql_stmt2||':b'||column_cur%rowcount;
    else
    sql_stmt1 := sql_stmt1 || col_rec.column_name ||',';
    sql_stmt2 := sql_stmt2||':b'||column_cur%rowcount||',';
    end if;
    type_rec(column_cur%rowcount) := col_rec.data_type;
    end loop;
    sql_stmt1 := sql_stmt1||')';
    sql_stmt2 := sql_stmt2||')';
    sql_stmt := sql_stmt1||sql_stmt2;
    dbms_output.put_line(sql_stmt);
    loop
    Begin
    UTL_FILE.GET_LINE(file_id,v_column_value);
         itr_count      :=     0;
         l_count :=1;
         processed     :=     FALSE;
    mainstr:=v_column_value;
         LOOP
              itr_count     :=      itr_count+1;
              IF instr(mainstr,',',1,itr_count)>0 THEN
                   splitstr      :=     SUBSTR(mainstr,l_count,(INSTR(mainstr,',',1,itr_count)-l_count));
                   l_count          :=     INSTR(mainstr,',',1,itr_count)+1;
              ELSE
                   splitstr      :=      SUBSTR(mainstr,l_count,LENGTH(mainstr)+1-l_count);
                   processed     :=     TRUE;
              END IF;
              v_rec(itr_count):=splitstr;
              IF processed THEN
                   EXIT ;
              END IF;
         END LOOP;
    v_cursor := DBMS_SQL.OPEN_CURSOR;
    --dbms_output.put_line(col_ctr);
    DBMS_SQL.PARSE(v_cursor, sql_stmt, dbms_sql.native);
    For i in 1..col_ctr loop
    if type_rec(i) = 'DATE' then
    DBMS_SQL.BIND_VARIABLE(v_cursor,':b'||to_char(i), to_date(v_rec(i),'DD/mm/yyyy'));
    elsif type_rec(i) = 'NUMBER' then
    DBMS_SQL.BIND_VARIABLE(v_cursor,':b'||to_char(i), to_number(v_rec(i)));
    elsif type_rec(i) = 'VARCHAR2' then
    DBMS_SQL.BIND_VARIABLE(v_cursor,':b'||to_char(i), v_rec(i));
    end if;
    end loop;
    v_dummy := DBMS_SQL.EXECUTE(v_cursor);
    if SQL%NOTFOUND then
    dbms_output.put_line('CPN_HISTORY_ARCHIVE_PKG.DEARCHIVE_DATA : No records to insert');
    end if;
    DBMS_SQL.CLOSE_CURSOR(v_cursor);
    Exception
    when NO_DATA_FOUND then
    UTL_FILE.FCLOSE(file_id);
    exit;
    End;
    end loop;
    UTL_FILE.FCLOSE(file_id);
    EXCEPTION
    when others then
    dbms_output.put_line(sqlerrm);
         UTL_FILE.FCLOSE(file_id);
    END;
    TEST:
    SQL> DESC EMP1
    Name Null? Type
    ENAME VARCHAR2(15)
    SUBJ VARCHAR2(15)
    SDATE DATE
    DATA FILE:
    AABC,oracle,08/08/2001
    xyz,social,12/12/2001
    SQL> select * from emp1;
    ENAME SUBJ SDATE
    AABC oracle 08/08/2001 00:00:00
    xyz social 12/12/2001 00:00:00

  • Reading and Writing to a Text File

    Hello all,
    I was wondering if it is possible to write from forms to a text file and if possible what is the best way to do it.
    Thanks,
    Bucky

    Use the TEXT_IO built-in functionality in forms or from the database utl_file. TEXT_IO seems to be more flexible because you can read and write to any server/directory you have access to whereas UTL_FILE is limited to the server where the database is located. Hope this helps.
    Mike

  • Reading and writing to a text file from an Applet

    I'm a novice java programming with very little formal programming training. I've pieced together enough knowledge to do what I've wanted to do so far...
    However, I've been unable to figure out how to read and write to a text file from an Applet (I can do it from a normal java program just fine). Here is a simple example of what I'd like to do (you can also look at it on my website: www.stat.colostate.edu/~leach/test02/test02.html). I know that there is some problem with permission/security but I'm not smart enough to understand what the error messages are telling or understand the few books I have. If anyone can tell me how to get this applet to work, or direct me to some referrences that would help me out I'd really appreciate it.
    Thanks,
    Andy
    import java.applet.Applet;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    public class test02 extends Applet {
    public Button B_go;
    public GridBagConstraints c;
    public void init() {
    this.setLayout(new GridBagLayout());
    c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    B_go = new Button("GO");
    c.gridx=1; c.gridy=0; c.gridwidth=1; c.gridheight=1;
    c.weightx = c.weighty = 0.0;
    B_go.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    print_stuff();
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    this.add(B_go,c);
    public static void print_stuff() {
    try{
    File f = new File("test02.txt");
    PrintWriter out = new PrintWriter(new FileWriter(f));
    out.print("This is test02.txt");
    out.close();
    }catch(IOException e){**/}
    }

    I have almost the exact same problem, and I am in the same situation as you are with respects to the language.
    I am simply trying to create a file and output some garbage to it but my applet always spits back a security violation. I've tried eliminating the restrictions on the applet runner I use but I still get the error.
    My method:
    debug = new Label() ;
    debug.setLocation( 20, 20 ) ;
    debug.setSize( 500, 15 ) ;
    add( debug ) ;
    // output
    try
         OutputStream file = new FileOutputStream( new File( "" + getCodeBase() + "output.txt" ) ) ;
         byte[] buffer = { 1, 2, 3, 4, 5 } ;
         file.write( buffer ) ;
         file.close() ;
    } catch( Exception e )
         debug.setText( e.toString() ) ;
         Can anyone tell why this isnt working?

  • Reading and Writing from a text file at the same time

    I know who to use the Scanner and PrintWriter to read from and write to a .txt file. But these are limited. How can I read and write at the same time? Such as open a file and change every third character or change every second word to something else and then write it back. I found this [http://java.sun.com/docs/books/tutorial/essential/io/|http://java.sun.com/docs/books/tutorial/essential/io/] but its a little over my head. Is this the only way to do it?

    wrote:
    You are using buffered reads and writes I would assume, right? Also, how do you think most programs handle this sort of thing? I don't believe I'm using buffering.
    My code looks something like this
    //...necessary imports
    //then
    Scanner inFile = new Scanner (new file("filename1.txt"));
    PrintWriter outFile = new PrintWriter ("filename2.txt");
    //then stuff like
    int x = inFile.hasNextInt();
    outFile.println(x);
    camickr wrote:If you are changing the data "in place", that is none of the data in the file is shifted, then you can use a RandomAccessFile.
    Otherwise, you've been given the answer above.What is RandomAccessFile? Is it what I have a link to? Basically what I do is I write a bunch of numbers to a txt file and then change the numbers I don't need anymore to 0. So say I had 0 1 2 3 4 5 6 7 etc. I would like to to open the txt file and change every second one to 0 so then I'd have only odd numbers and 0s.
    I looked at the documentation for RandomAccessFile and it seems like it might be what I need.
    Thankyou both for your help so far. I took a java course in high school and they only taught me one way to get data from text files and that is what I just showed you. So maybe this questions are really stupid. lol
    Edited by: qw3n on Jun 13, 2009 7:46 PM

  • How do I read from a text file that is longer than 65536 lines and write the data to an Excel spreadshee​t and have the data write to a new column once the 65536 cells are filled in a column?

    I have data that is in basic generic text file format that needs to be converted into Excel spreadsheet format.  The data is much longer than 65536 lines, and in my code I haven't been able to figure out how to carry over the data into the next column.  Currently the conversion is done manually and generates an Excel file that has a total of 30-40 full columns of data.  Any suggestions would be greatly appreciated.
    Thanks,
    Darrick 
    Solved!
    Go to Solution.

    No need to use nested For loops. No need for any loop anyway. You just have to use a reshape array function. The picture below shows how to proceed.
    However, there may be an issue if your element number is not a multiple of the number of columns : zero value elements will be added at the end of the last column in the generated 2D array. Now the issue depends on the way you intend store the data in the Excel spreadsheet : you could convert the data as strings, replace the last zero values with empty strings, and write the whole 2D array to a file (with the .xls extension ) using the write to spreadsheet function. Only one (minimal) problem : define the number of decimal digits to be used;
    or you could write the numeric array directly to a true Excel spreadsheet, using either the NI report generation tools or ActiveX commands, then replace the last elements with empty strings.
    We need more input from you to decide how to solve these last questions. 
    Message Edité par chilly charly le 01-13-2009 09:29 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_VI.png ‏10 KB

Maybe you are looking for

  • Using  the current version of photoshop CC with Mac OS 10.9 for the next 5 or so years on same mac?

    I am intending to upgrade to photoshop CC from photoshop CS6, my concern is is my computer is 6 years old and probably I will not be able to upgrade to a later mac operating system as I have mac os 10.9, and I may not be able to upgrade to a future v

  • Document assembly not allowed

    I have created several PDF forms using Adobe Designer 7.0 for Windows XP and I want to compile them into a single PDF document using Adobe Acrobat Professional 7.0's "Create PDF from multiple files" option. But when I try, I get a message that "The f

  • Better capture with FCP than iMovie?

    Hi, I have an ADVC-100 and wish to archive some old VHS and S-VHS tapes. I'm planning to to that in iMovie HD. However, would I be getting bettter quality if I used FCP instead? Any input on how to get the best quality out of old VHS tapes would be g

  • Oracle name server error

    C:\>sqlplus scott/tiger@namestest SQL*Plus: Release 8.1.7.0.0 - Production on Fri Jun 14 14:16:13 2002 (c) Copyright 2000 Oracle Corporation. All rights reserved. ERROR: ORA-12637: Packet receive failed what can I do for this error.

  • HT3275 Sparsebundle already in use?

    Hi I get the following warning "Time Machine couldn't complete the backup to "JAOC Wireless".The backup disk image "/Volumes/James & Anna Treadwell's Ti/Anna's MacBook Air.sparsebundle" is already in use"  Can anyone tell me how to solve this?  Thank