dbTalk Databases Forums  

Text File Manipulation in ActiveX

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Text File Manipulation in ActiveX in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
magpie1978
 
Posts: n/a

Default Text File Manipulation in ActiveX - 10-10-2006 , 12:02 PM






Hi,

I am wanting to be able to loop through a text file from a DTS package
that looks to check that the line length is 720 characters. If it is
not 720 characters then I want to add blank space to take it up to 720
characters.

A colleague gave me the following code:

Dim TextLine, TempStr
Open "c:\test.txt" For Input As #1
LineInput #1, TextLine
Open "c:\test2.txt" For Output As #2
Do While Not EOF(1)
While Len(TextLine) < 720
TextLine = TextLine + " "
Wend
Print #2, TextLine
Loop
Close #1
Close #2

This doesn't look 100% correct to me, but I can't work out where he's
gone wrong. It doesn't work when i try to run the code in DTS Package.

Can anyone help?

Many thanks
Chris


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.