Forum Discussion
tristaanogre
13 years agoEsteemed Contributor
"On the fly" is an idiom that essentially means that, instead of configuring your files and folders ahead of time for use with your scripts, you're changing the files during the course of the script run.
I understand what you're trying to do with the files and folders, I'm just curious as to why. Is there some reason why you need to do all this file and folder manipulation as script code? Why not just manually edit all the files and folders to be the values you need them rather than having script code do so?
In any case, what you might need to do is, instead of reading the whole file in as text, read only the first line in, do your replace on that line, and then write the result out to your file, replacing all contents.
You'll need to use aqFile.OpenTextFile which returns an object of type aqTextFile. This is probably what you'll need to use in order to specifically grab just the one line, alter it, and then dump just that line down to your file.
I understand what you're trying to do with the files and folders, I'm just curious as to why. Is there some reason why you need to do all this file and folder manipulation as script code? Why not just manually edit all the files and folders to be the values you need them rather than having script code do so?
In any case, what you might need to do is, instead of reading the whole file in as text, read only the first line in, do your replace on that line, and then write the result out to your file, replacing all contents.
You'll need to use aqFile.OpenTextFile which returns an object of type aqTextFile. This is probably what you'll need to use in order to specifically grab just the one line, alter it, and then dump just that line down to your file.
Related Content
Recent Discussions
- 8 hours agod_gfleetwood92
- 9 hours agoFFCB