How to edit a TXT file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to edit a TXT file

  1. #1
    Maford Guest

    How to edit a TXT file

    I have an existing TXT file, and I want to edit only a few texts inside. How
    can I do this with the OPEN statement? I already tried Open Statement with
    the Output # Statement, but it only delete all texts inside my texts file.
    Does anyone have a better idea?


    Thanks in advance.
    MI



  2. #2
    Craig Brown Guest

    Re: How to edit a TXT file


    Maford,

    Open the file for input. Edit the fields you need to edit/change. Write
    it out to a new file. Blow away the first one. Rename the new one to the
    old name.

    Craig Brown

    "Maford" <mayee_yra@hotmail.com> wrote:
    >I have an existing TXT file, and I want to edit only a few texts inside.

    How
    >can I do this with the OPEN statement? I already tried Open Statement with
    >the Output # Statement, but it only delete all texts inside my texts file.
    >Does anyone have a better idea?
    >
    >
    >Thanks in advance.
    >MI
    >
    >



  3. #3
    rhwiebe Guest

    Re: How to edit a TXT file


    Craig: Your answer more complex than necessary.
    Open file, read it, close it, edit it internally,
    then reopen with "output" and overwrite old with new.
    Simpler and faster.
    Luck - Richard

    "Craig Brown" <brownc3@ing-afs.com> wrote:
    >
    >Maford,
    >
    >Open the file for input. Edit the fields you need to edit/change. Write
    >it out to a new file. Blow away the first one. Rename the new one to the
    >old name.
    >
    >Craig Brown
    >
    >"Maford" <mayee_yra@hotmail.com> wrote:
    >>I have an existing TXT file, and I want to edit only a few texts inside.

    >How
    >>can I do this with the OPEN statement? I already tried Open Statement with
    >>the Output # Statement, but it only delete all texts inside my texts file.
    >>Does anyone have a better idea?
    >>
    >>
    >>Thanks in advance.
    >>MI
    >>
    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center