Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FileSystemObject help please. | Excel Programming | |||
FileSystemObject help please. | Excel Programming | |||
Filesystemobject Help | Excel Programming | |||
filesystemobject | Excel Programming | |||
FileSystemObject | Excel Programming |