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


Hi Leith,

Here's a belated thanks! I solved it in a very similar way. Here's my
code for posterity

Dim FinalFile As Integer
Dim PreFile As Integer
Dim PreName(1 To 25) As String
Dim FinalName(1 To 25) As String
Dim fso As Object
Dim Temp As String


FinalName(numberofwafermaps) =
WafermapPath & ERsheetname(I) & ".txt"
PreName(numberofwafermaps) =
WafermapPath & ERsheetname(I) & "-pre.txt"
FinalFile = FreeFile()


Set fso =
CreateObject("Scripting.FileSystemObject")

If
(fso.FileExists(FinalName(numberofwafermaps))) Then
Kill
FinalName(numberofwafermaps)
End If

Close #FinalFile
Open FinalName(numberofwafermaps)
For Append As FinalFile
Print #FinalFile, "Mesh AutoCreate"


PreFile = FreeFile()

Open PreName(numberofwafermaps)
For Input As PreFile
'
Do While Not EOF(PreFile)
Line Input #PreFile, Temp
Print #FinalFile, Temp
Loop

'CloseFiles:
'
' ' Close the destination file and
the source file.
Close #PreFile
Close #FinalFile

If
(fso.FileExists(PreName(numberofwafermaps))) Then
Kill
PreName(numberofwafermaps)
End If


--
lif
------------------------------------------------------------------------
lif's Profile: http://www.excelforum.com/member.php...o&userid=35745
View this thread: http://www.excelforum.com/showthread...hreadid=563543



 
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
Reading a text file line by line stressman Excel Programming 3 October 16th 05 05:29 AM
Reading a text file line by line Foss[_2_] Excel Programming 4 March 16th 05 04:01 PM
import huge text file line-by-line? rachel Excel Programming 2 November 6th 04 04:43 PM
appending data from an external text file clui[_7_] Excel Programming 1 December 4th 03 01:21 AM
Appending to File Progster Excel Programming 1 September 22nd 03 02:24 PM


All times are GMT +1. The time now is 07:53 PM.

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"