Using VB6
code
Dim fso As FileSystemObject
Dim TS As TextStream
Dim TempS As String
Dim Final As String
Set fso = New FileSystemObject
Set TS = fso.OpenTextFile(1.txt, ForReading)
Final = TS.ReadAll
Do Until TS.AtEndOfStream
TempS = TS.ReadLine
Final = Final & TempS & vbCrLf
Loop
TS.Close
Set TS = fso.OpenTextFile(App.Path & "\Staff.txt", ForAppending, True)
TS.Write Final
TS.Close
Set TS = Nothing
Set fso = Nothing
Above code is working, but I want add one more line while writing in Staff.txt.
Textfile
1.txt
M3,4331,57,0,3,,20090405,153601,8193,3,0,,,,
M3,4440,59,0,3,,20090405,172110,8193,3,0,,,,
M3,4439,66,0,1,,20090405,172106,8193,3,0,,,,
M3,4374,68,0,1,,20090405,165003,8193,3,0,,,,
Expected Output
When writing a file as Staff.txt
Col1, col2, col3, col4, col5, col6..
M3,4331,57,0,3,,20090405,153601,8193,3,0,,,,
M3,4440,59,0,3,,20090405,172110,8193,3,0,,,,
M3,4439,66,0,1,,20090405,172106,8193,3,0,,,,
M3,4374,68,0,1,,20090405,165003,8193,3,0,,,,
I want to add above one line like col1, col2, col3…. So on…,.
How to modify a code?
Need VB6 Code Help