Hi Team
I need to insert a line of test at the beginning of a csv file using an ActiveX Script Task in SQL 2000. Does anyone know of an elegant way to do this?
Thanks FW
Printable View
Hi Team
I need to insert a line of test at the beginning of a csv file using an ActiveX Script Task in SQL 2000. Does anyone know of an elegant way to do this?
Thanks FW
Open an output file. Write the line to be inserted. Open the existing file. Read it and write it to the output file. Close both files. Kill the input file. Rename the output file to the original name.
You can't insert into an existing file.
Thanks AL, I was hoping there was a way without copying the whole contents. But never mind, looks like this is the way.
RW
another way you can do it, though it may not be popular here, is to write the additional information to a new file then shell to dos and use copy to combine the 2 files
peteQuote:
To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).