drstrangelove
01-23-2001, 04:02 PM
Ok here goes...
I am new to VB (blah blah blah-you've heard it all before.) i don't want ppl to tell me exactly what to type (unless it is EXTREMELY difficult hehehe) but to point me somewhere to find the answer myself.
I have a file (text file) i need to copy to a new directory and then erase the first line if it doesn't equal "MAKE" (without the quotes) and replace it with "FILE" (also without the quotes) concatenated with a variable.
I have gotten far enough to copy the file. but the OPEN deal is giving me a headache. Open for append adds the new data to the bottom. open for output erases the file before reading it to buffer, and write # adds quotation marks (according to the book I have). I think I know what I need to do, but I am unsure how to go about doing it.
Instead of copying the file and then editing it would it be easier/better for me to open it for input from it's original location and then open it for output at it's new location (my book made it seem that if i did this it would create the file if it didn't already exist.) But after that, I don't know how to do the if stuff to check for the "MAKE" (I guess that's what I need to do).
Any suggestions would be greatly appreciated. Feel free to email me if you want. If this didn't make sense, post a reply or email me for more info.
Thanks
Dr. Strangelove
------------------
Never go up against a Sicilian when death is on the line!!
Hahahahahahaha***
I am new to VB (blah blah blah-you've heard it all before.) i don't want ppl to tell me exactly what to type (unless it is EXTREMELY difficult hehehe) but to point me somewhere to find the answer myself.
I have a file (text file) i need to copy to a new directory and then erase the first line if it doesn't equal "MAKE" (without the quotes) and replace it with "FILE" (also without the quotes) concatenated with a variable.
I have gotten far enough to copy the file. but the OPEN deal is giving me a headache. Open for append adds the new data to the bottom. open for output erases the file before reading it to buffer, and write # adds quotation marks (according to the book I have). I think I know what I need to do, but I am unsure how to go about doing it.
Instead of copying the file and then editing it would it be easier/better for me to open it for input from it's original location and then open it for output at it's new location (my book made it seem that if i did this it would create the file if it didn't already exist.) But after that, I don't know how to do the if stuff to check for the "MAKE" (I guess that's what I need to do).
Any suggestions would be greatly appreciated. Feel free to email me if you want. If this didn't make sense, post a reply or email me for more info.
Thanks
Dr. Strangelove
------------------
Never go up against a Sicilian when death is on the line!!
Hahahahahahaha***