Jump to content

Is it possible to edit a line in the middle of text file?


Recommended Posts

Hi all,

I'm keeping a record of purchase orders my company raises by dumping them into a text file. Each purchase order has a unique number so I can fish the info up again into my GUI. Its working well, except now I would like to edit the purchase order to mark when the goods are received. Is there a way I can edit a line in the middle of a text file?

Part of me has this odd idea of sucking out all the lines in the file except the one I'm working with and re-writing them to a new file, then adding my ammended line to that.. but I'm hoping there is a cleaner way of doing this.

Any assistance is appreciated.

Link to comment
Share on other sites

Hi all,

I'm keeping a record of purchase orders my company raises by dumping them into a text file. Each purchase order has a unique number so I can fish the info up again into my GUI. Its working well, except now I would like to edit the purchase order to mark when the goods are received. Is there a way I can edit a line in the middle of a text file?

Part of me has this odd idea of sucking out all the lines in the file except the one I'm working with and re-writing them to a new file, then adding my ammended line to that.. but I'm hoping there is a cleaner way of doing this.

Any assistance is appreciated.

Yes. Look in help file about _FileWriteToLine().

Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...