Private Sub CombineFiles(filein1 As String, filein2 As String, fileout As String,)
Dim sText1$, sText2$
Open filein1 For Input As #1
sText1 = Input(LOF(1), #1)
Close #1
Open filein2 For Input As #1
sText2 = Input(LOF(1), #1)
Close #1
Open fileout For Output As #1
Print #1, sText1
Print #1, sText2
Close #1
End Sub
Private Sub CombineFiles(filein1 As String, filein2 As String, fileout As String,)
Dim sText1$, sText2$
Open filein1 For Input As #1
sText1 = Input(LOF(1), #1)
Close #1
Open filein2 For Input As #1
sText2 = Input(LOF(1), #1)
Close #1
Open fileout For Output As #1
Print #1, sText1
Print #1, sText2
Close #1
End Sub
it has an extra blank line on the end of "Output.txt"
how to remove the blank line?
it has an extra blank line on the end of "Output.txt"
how to remove the blank line?
What do you mean by "extra"? The last 2 characters in the file are vbCR and vbLF, because the last thing done to the file was to print a line. If you want to eliminate that line, change Print #1, sText2 to Print #1, sText2;
If there are 2 blank lines at the end, it's because there's an extra line at the end of the second file. Remove any occurrences of vbNewLine & vbNewLine (two of them in a row) from the end of sText2 before you print it to the output file.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana