Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append Footer to txt File 1

Status
Not open for further replies.

mlabac

Programmer
Jan 22, 2004
23
US
I need to append a footer (1 field as a string) to the last line in an existing text file that i have exported via DTS.

I have been looking at the Writefile transformation but can't seem to get it to work.

Thoughts
 
Writefile transformation is not for this purpose.

Since it's late, I won't start thinking of possible solutions. How about the old fashin way, Windows command:

echo This is the last line of the file >> myfile.txt

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
Figured it out...pretty easy

Wrote an ActiveX script from DTS

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso_OpenTextFile(Path, ForAppending, False)
f.Write strFooter
f.Close

Appends the string 'strFooter' to the last line in the text file.
 
That was my other suggestion, I was too tired to start writing it.

Star for you, since you found the solution.

Cheers


[blue]Backup system is as good as the latest recovery[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top