×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    22

    Updating text files, J2ME

    Hi all

    I wrote an app that writes textfield data to a text file on the device memory card. I can also read the text file and split the various substrings back into the correct textfields. Now i want to know if its possible to change the data in one of the textfields and then to update the string in the text file to only update the changed substring data, i.e. the original string in the text file looks like this:

    John|Adams|33|Male|Single

    Now i want to update the string in the text file to look like this:

    John|Adams|33|Male|Married

    Please can anyone help me with some example code if this is possible??

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,560

    Re: Updating text files, J2ME

    No. The typical method is to rename the original file, write all old and unchanged data to a new file with the old name, then the changed data, then the rest. After that, close the new file and delete the renamed file. (Alternatively, write to a new temporary file, and efter you're done, delete the old and rename the new to the old name as the last step.)

    If the file is small, you can also read all the contents to memory, change the data in memory, and then write all the data back in one go (more or less).

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    22

    Re: Updating text files, J2ME

    Thanks petrib

    I am having some trouble as well reading the text file on my Nokia 5800 xpress. Keeps giving me the error message: DOM org.w3c.dom.DOMException Not a child of this node. Do you perhaps have any sample code that could help with reading text files on Nokias (S60 5th edition)?? Or any help concerning the error message??

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Updating text files, J2ME

    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    22

    Re: Updating text files, J2ME

    Hi

    I am reading my text file from my device memory card line by line, but now I want to display the read text on an Alert INFO message, as well as pass each individual read line to a different string so that I can manipulate the specific strings through substring() etc. Can anyone please help me with this??

Similar Threads

  1. Dynamic updating a listbox item's text font
    By Comp_users in forum Symbian User Interface
    Replies: 1
    Last Post: 2010-03-17, 05:34
  2. J2me for how to use jsr 75 to save text files in mobile memory
    By chatrapati.nokia.santhosh in forum Mobile Java General
    Replies: 34
    Last Post: 2009-10-07, 10:22
  3. Updating CEikLabel text
    By tunelabguy in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-05-07, 00:17
  4. [snippets pys60 updating] find db files
    By cyke64 in forum Symbian
    Replies: 1
    Last Post: 2006-02-14, 07:31
  5. Updating screen on rich text editor.
    By hclemson in forum Symbian
    Replies: 11
    Last Post: 2005-07-18, 13:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×