| Author |
Topic |
|
heygee
Starting Member
27 Posts |
Posted - 2006-01-26 : 04:43:47
|
| Hi all,I am having a problem with a DTS package I am writing. The package is getting text from a table and putting it out to a text file. I have most of it sorted, and contains text like this:PN,GEN,T_KI-3,2006-01-24 00:30,480,2006-01-24 01:00,480PN,GEN,T_KI-2,2006-01-24 00:40,484,2006-01-24 02:00,482PN,GEN,T_KI-3,2006-01-24 00:50,490,2006-01-24 05:00,486What I need is a line at the end of the text which is:<EOF>So the output from this will look like:PN,GEN,T_KI-3,2006-01-24 00:30,480,2006-01-24 01:00,480PN,GEN,T_KI-2,2006-01-24 00:40,484,2006-01-24 02:00,482PN,GEN,T_KI-3,2006-01-24 00:50,490,2006-01-24 05:00,486<EOF>I am having problems adding the line at the end of the text file. Can anyone advice me of a good solution or show me where I amn going wrong?TAI,GeeGee"Happiness is a good health and a bad memory!" |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2006-01-26 : 05:28:27
|
You could tryEXEC master..xp_cmdshell 'echo EOF >> C:\test.txt', NO_OUTPUTI removed <> from EOF as it doesnt like it unless encapsulated in ""AndyBeauty is in the eyes of the beerholder |
 |
|
|
heygee
Starting Member
27 Posts |
Posted - 2006-01-26 : 05:58:03
|
| Thanks, but I have just tried this as an extra step in the DTS Package and also included in the original scrip. Were you able to get this to work as it doesn't seem to work for me.Gee"Happiness is a good health and a bad memory!" |
 |
|
|
AndyB13
Aged Yak Warrior
583 Posts |
Posted - 2006-01-26 : 07:16:51
|
Yes that works, run it in QA.The >> appends to the file a single > creates/overwrites a fileDont forget that the file will be wherever the connection is set to (may not be local), i have made that mistake a few times when i thought it wasnt workingAndyBeauty is in the eyes of the beerholder |
 |
|
|
jsiedliski
Yak Posting Veteran
61 Posts |
Posted - 2006-08-24 : 19:58:42
|
| Anyone know if you can force DTS to easily append to the same text file? (by default DTS deletes the file, if it exists and creates a new one). I am sure it could be done using ActiveX, but was wondering if there was an easier way.Thanks,Jack:) |
 |
|
|
|
|
|