LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FileSystemObject

Hi

I've got a fuinction which adds carriage returns to a text file:

Private Function Do_FS_Stream()
'Add Carriage Returns
Set fsin = CreateObject("Scripting.FileSystemObject")
Set fsout = CreateObject("Scripting.FileSystemObject")
Set fstream = fsin.opentextfile(ImportFilename)
Set fstreamout = fsout.createtextfile(ImportFilename & ".tmp")
'use temp file for replace
fstreamout.write (sReplace(fstream.readall, "'", "'" & vbCrLf))

Set fsin = Nothing
Set fsout = Nothing
Set fstream = Nothing
Set fstreamout = Nothing
DoEvents

'remove temp file
FileCopy ImportFilename & ".TMP", ImportFilename 'rename file
Kill ImportFilename & ".TMP"
End Function


This works perfectly, however sometimes files get reprocessed many
times so we end up with lots of carriage returns.

Is there any way, to check if the file contains carriage returns, and
then only put them in if it needs to.

Cheers
Graeme.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystemObject help please. Tom Ogilvy Excel Programming 0 July 8th 05 04:44 PM
FileSystemObject help please. Bob Phillips[_7_] Excel Programming 0 July 8th 05 04:44 PM
Filesystemobject Help CyndyG Excel Programming 4 May 17th 05 01:00 AM
filesystemobject Alvin Hansen[_2_] Excel Programming 3 January 27th 05 06:17 PM
FileSystemObject lol[_2_] Excel Programming 2 April 6th 04 09:56 PM


All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"