Text update writing
Blitz3D Forums/Blitz3D Beginners Area/Text update writing
| ||
I have two text files in a directory. The first text file is called text1.txt . The second text file is called text2.txt. Using Blitz3d, how can I make it so that all the information from text1 and text2 be written to a new text file named text3.txt? |
| ||
Here's a straightforward way:t1 = OpenFile("text1.txt") t2 = OpenFile("text2.txt") t3 = WriteFile("text3.txt") If t1 And t2 And t3 Then While Not Eof(t1) : WriteLine(t3, ReadLine$(t1)) : Wend While Not Eof(t2) : WriteLine(t3, ReadLine$(t2)) : Wend EndIf Or, you can also use ExecFile with cmd.exe or command.com, to use the DOS Copy command, like this copy text1.txt+text2.txt text3.txt |