Jump to content
Sign in to follow this  
medicalert

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

Recommended Posts

medicalert

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.

Share this post


Link to post
Share on other sites
Andreik

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

Share this post


Link to post
Share on other sites
medicalert

Thank you kindly Andreik,

much obliged. ;)

Share this post


Link to post
Share on other sites
Andreik

Welcom to AutoIt Forum. ;):D


When the words fail... music speaks

Share this post


Link to post
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
Sign in to follow this  

×