Is it possible to read/write to text file without deleting it?

I know how to read from a text file and how to write to a text file. The problem that i have is i need to use a text file to store data for my application to read and also for my application to write. I would like it if i could write two programs really, one reads, the other is used to update the text file. This file is a list of verbs. I thought about using databases but i couldn't get them to work. I downloaded MySQL server 5.0 and installed it. I then downloaded the driver from http://www.mysql.com/products/driver and ran the auto installer. it said everything worked out perfectly but when i try these lines:
Class.forName("com.mysql.jdbc.Driver");
I get a SQLException that says no suitible driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
( I thought this driver came with the JDK but i guess not, i just read about it in a java book)
I get a ClassNotFoundException
that just says sun.jdbc.odbc.JdbcOdbcDriver
So yeah, SQL is pretty much not working. I need a solution to my problem, either by using text files, or a different type of database. I heard you could use excel to create a database but i have no idea how and i hear microsoft access could also do this, however i don't have microsoft access and i don't intend on paying for it. So, here are my questions:
1st, is there a tutorial on using excel databases in java programs
(if not)
2nd is there a way to read/write/update a text file without deleting it?
(if not)
3rd is there a way to get SQL working, i have windows vista this could be the problem
(if not)
4th what could i do to store information on the hd for reading and modifying later?
thanks, lateralus

A database might be overkill just for a list of words.
Thoughts:
<ul>
<li>What is the extent of your "file updating"? If you are just appending to the file, opening it in append mode will keep the file from being clobbered.</li>
<li>Otherwise, why not create new files instead of editting them? The file names could include a version number or timestamp, allowing the reader to select the newest one.
</li>
</ul>

Similar Messages

  • Write to text file without server side

    Hi,
    I need to write data into a text file for saving data from my
    flash movie, but I didn't have the possibility to use a
    server-side.
    Because my flash movies are stored on a CD and it must be
    compatible with Windows and MacOS.
    Is it possible to write data into a text file?
    If no, can I use a third party software? Which one?
    Regards
    YamNet

    A SharedObject might work for you. Otherwise, you'll need a
    'wrapper' app.
    Adobe's own Director works very well for this, and AIR would
    work as well.
    There are also a good number of 3rd party apps, such as Zinc
    and others.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • HOW TO WRITE AND READ FROM A TEXT FILE???

    How can I read from a text file and then display the contents in a JTextArea??????
    Also how can I write the contents of a JTextArea to a text file.
    Extra Question::::::: Is it possible to write records to a text file. If you have not idea what I am talking about then ignore it.
    Manny thanks,
    your help is much appreciated though you don't know it!

    Do 3 things.
    -- Look through the API at the java.io package.
    -- Search previous posts for "read write from text file"
    -- Search java.sun.com for information on the java.io package.
    That should clear just about everything up. If you have more specific problems, feel free to come back and post them.

  • Is it possible to read/write data from Salesforce using web service hub in Informatica?

    Anyone from Informatica can asnwer this question please

    Is it possible to read/write data from Salesforce using web service hub in Informatica? Not asking about PowerExchange for Salesforce or Informatica Cloud. Just using web service can we load data into Salesforce? Thanks ahead.

  • Write to text file qeustion

    Hello all,
    My first question about writing to text file is does the file need to be opened? i know you have the option to create, replace, open..., but does it need to be opened in order to properly write data to the file? Also if my application is running with a disk streaming file setup and i open the file that it is writing to will this cause an error or cause labview to lose control of the file and possibly stop writing to the file?
    Thank you,
    Matt

    Feel free to experiment.  Try writing to a file from multiple locations at once, and you'll see race conditions where data could be lost.
    The reason for the Open, Write, Close type of software is because generally you are in a loop continually writing to a file, and the extra overhead of a Open and Close can be limited to when the software starts and closes, instead of having to open a new reference and close it every time you want to write to the file.  Just open the reference once, work with it in a while loop, then close it once, must more efficient and better for applications that write many times to disk.
    Is it necessary?  No you can just use the Write to Text file giving it a path and data to write, but behind that function it will need to open and close the reference each time.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Write to Text File.vi Output file all but first line start with tab

    The attached PNG shows the code used to build up concatenated strings into a string array for the first four lines, thence to a string Array, to Spreadsheet String.vi and, finally, the use of Write to Text File.vi
    The lower right corner shows the result loaded into a spreadsheet. Note the 3 blank entries marked by a filled red rectangle. Examination of hidden characters shows there is a tab at the beginning of lines 2, 3 and 4.
    There is no tab shown in the code. How do those tabs get there? How do I stop them?
    I have tried with the option "Convert EOL" both on and off with no difference.
    The Help states that an OS-dependent EOL character is appended to each line. I can't imagine the Windows EOL character includes a tab.
    Solved!
    Go to Solution.
    Attachments:
    Tab Mystery.PNG ‏29 KB

    wildcatherder wrote:
    I am still puzzled as to why those additional tabs were added by Array to Spreadsheet String.  I'm holding in my hand a printout of an old LabVIEW 8 program with that construction, which is known to work properly.
    Makes complete sense when you look at your code.  You build a string, including an end-of-line character, and put that string into an array.  Then, when you run it through Array to Spreadsheet String, it puts a tab after every array element, and new line at the end of each row in the array.  The first element of your array contains a new line but Array to Spreadsheet String doesn't know about it; it still inserts a tab between that array element and the next one, giving you the tabs.

  • Reading of a text file in J2ME

    Hi,
    I have a problem with the reading of a text file:
    String conn = "file:///root1/formazione.txt";
    FileConnection file = (FileConnection)Connector.open(conn,Connector.READ);
    InputStream is = null;
    if(filecon2.exists()) {
    DataInputStream dis = file.openDataInputStream();
    dis.readUTF());
    Error is:
    java.io.EOFException
    at java.io.DataInputStream.readFully(+48)
    at java.io.DataInputStream.readUTF(+30)
    at java.io.DataInputStream.readUTF(+4)
    at mainPackage.FileReader.run(+597)
    Must I read byte and change it in String?

    How did you write the file? Did you use writeUTF?
    Try reading the file through a normal read, read() or read(byte[])

  • Write to text file problem

    I have a write to 'text file' in a sub vi. It is a popup where user can change his program.
    For some reason, only the first time it is called, it actually writes to the text file.
    As long as the sub vi is in memory, and I call it again and press ok to write to text file, nothing happens.
    I've tried 'close file', but that doesnt help. Deleting the files from the disk before again calling the sub vi doesnt help either, it wont write
    to file again. Is this a bug or am I missing something?! Im on labview 2010

    Post your VI (along with sub-VI's if any).
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • "Write to text file" when button is pushed?

    I want to use the function "write to text file" when a button is pushed, and write only once.
    The same goes for "read from text file

    Hello!
    Look at the following examples shipped with LabVIEW Professional and LabVIEW Full. Event structure example is not installed with Base package. 
    Open up 'Example Finder', click on the 'Search' tab, enter keyword 'events' and you fill find several examples. The ones of interest for you is 'New Event Handler.VI" and 'Old Event Handler.VI', where the first uses the event structure and the other uses the standard state machine architecture.
    Regards,
    Jimmie Adolph
    Systems Engineer Manager, National Instruments Northern Region
    Bring Me The Horizon - Sempiternal

  • Write to Text File - unflatten channel string

    Hi all,
    This is my first post on the forums!  It's been very helpful for me but I have not been able to find a solution to my (simple) problem.
    Operating system: Windows 7 (64-bit)
    Labview 2012 Full Development
    I'm using the DAQmx unflatten channel string to get the names of the channels, and when I Write to Text File, I get the names of channels to be displayed vertically, ie a new row for each channel in a column.  I'd like to "transpose" this, but obviously you cannot transpose a 1d array.  Any ideas on how I can do this?
    Any and all ideas are appreciate, thank you in advance,
    -AK
    Solved!
    Go to Solution.

    Show us how you are doing this.
    My guess is that once you get the data, you have linefeed characters separating the channel names rather than some other delimiter such as a comma or a tab.
    Depedning on how you are going from the channel names to the file (a string, an array of strings, Write to Spreadsheet File, Write to Text file, ....) will determine the best way to fix the problem for you.

  • Write to text file (including spaces/next line) using oracle??

    How to write to text file using oracle? And how do I handle spaces/next line? (i was trying to use spaces(ch(32)), however it is just converted into squares in the text file.) thanks!

    989873 wrote:
    How about tabs?It does not matter what character it is. UTL_FILE deals correctly with any text file. Tabb is CHR(9):
    SQL> declare
      2       v_file utl_file.file_type;
      3       v_total_rec number := 0;
      4       v_total_sal number := 0;
      5  begin
      6      v_file := UTL_FILE.FOPEN('TEMP','TEST.TXT','w');
      7      for v_rec in (select * from emp) loop
      8        v_total_rec := v_total_rec + 1;
      9        v_total_sal := v_total_sal + v_rec.sal;
    10        UTL_FILE.PUT_LINE(
    11                          v_file,
    12                          lpad(v_rec.deptno,2) || chr(9) || rpad(v_rec.ename,14) || chr(9) || to_char(v_rec.sal,'99999D99')
    13                         );
    14      end loop;
    15      UTL_FILE.PUT_LINE(v_file,'Total Salary:' || chr(9) || v_total_sal);
    16      UTL_FILE.PUT_LINE(v_file,'Total Records:' || chr(9) || v_total_rec);
    17      UTL_FILE.FCLOSE(v_file);
    18  end;
    19  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2       v_file utl_file.file_type;
      3       v_line varchar2(100);
      4  begin
      5      v_file := UTL_FILE.FOPEN('TEMP','TEST.TXT','r');
      6      loop
      7        UTL_FILE.GET_LINE(v_file,v_line);
      8        DBMS_OUTPUT.PUT_LINE(v_line);
      9      end loop;
    10    exception
    11      when no_data_found
    12        then
    13          UTL_FILE.FCLOSE(v_file);
    14  end;
    15  /
    20      SMITH              800.00
    30      ALLEN             1600.00
    30      WARD              1250.00
    20      JONES             2975.00
    30      MARTIN            1250.00
    30      BLAKE             2850.00
    10      CLARK             2450.00
    20      SCOTT             3000.00
    10      KING              5000.00
    30      TURNER            1500.00
    20      ADAMS             1100.00
    30      JAMES              950.00
    20      FORD              3000.00
    10      MILLER            1300.00
    Total Salary:   29025
    Total Records:  14
    PL/SQL procedure successfully completed.
    SQL>SY.

  • Write a text file on client

    I want to realise an applet which can write a text file on client. I use java 2 and an certified applet.
    I'm searching a script.
    If you have a solution or a script thank you.
    A+
    Ps: I'm french and sorry for my english

    FileOutputStream fos = new FileOutputStream(filname);
    DataOutputStream dos = new DataOutputStream(fos);
    try {
    dos.writeBytes("some string");
    } catch (Exception e) {
    out.println(e.toString());
    dos.close();
    fos.close();

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • Reading from a text file into a 2D array

    How do you read from a text file and put it into a 2D array? Or if someone could guide me to where I can find the information?

    This tutorial shows how to read a file:
    http://java.sun.com/docs/books/tutorial/essential/io/scanfor.html
    This tutorial shows how to create arrays with multiple dimensions:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html

  • How to read from a text file one character at a time?

    Hello
    I wish to read from a text file in a for loop and that on every iteration i read one charachter and proceed to the next one.
    can anyone help me?
    Lavi 

    lava wrote:
    I wish to read from a text file in a for loop and that on every iteration i read one charachter and proceed to the next one.
    can anyone help me?
    Some additional comments:
    You really don't want to read any file one character at a time, because it is highly inefficient. More typically, you read the entire file into memory with one operation (or at least a large chunk, if the file is gigantic) and then do the rest of the operations in memory.  One easy way to analyze it one byte at a time would be to use "string to byte array" and then autoindex into a FOR loop, for example.
    Of course you could also read the file directly as a U8 array instead of a string.
    Message Edited by altenbach on 06-10-2008 08:57 AM
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • How can I add a new line item for production order?

    HI all, How can I add a new line item for production order through BAPI/FM? Thanks in advance.

  • Why is my Macbook Pro running so slowly/Pinwheeling all the time in maverick?

    In Firefox, Mail, Pages, everywhere!  My hard drive is about 1/3 full, I'm not running anything except Firefox, mail, pages,  & quicken.  I did a disk repair (there were problems) but now they're fixed and it's not any better.  Ideas please?

  • Response Groups not working

    Hi there My environment is a single Lync 2013 Front End Server installed on Server 2012. It works since a year and now we want to use some response groups. I created 2 of them and everything seems fine but i cant call these groups. Not from internal

  • Connecting my western digital drive with airport to use with my idevices

    I purchased "my book essiential" i had it reformatted at the apple store to be used by my apple products. Now I have it connected to my "airport extreme base" and I need to establish an access with my  book essential using my iPad and my iPhone. At t

  • CS4 design standard Etudiant

    Bonjour, Mon fils est entré cette année en 1ère année BAC PRO Communication graphique (PAO). Le lycée où il est utilise une version CS3, ils pensent passer en version CS4 dans le courant de l'année. La version proposé sur Adobe Store est la CS5.5.Il