954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

creating text file

good day everyone! I have a problem regarding to my program. i want to create a multiple text file. To be clear to you, i'll give an example.

for example I want create a textfile named as text1.txt and another textfile text2.txt.
What possibly is the solution to prevent the 1st txt file to be overwritten by the 2nd txt file.

Is there any easy code that can I use?

Thank you in advance! :)

vin24
Newbie Poster
23 posts since Sep 2010
Reputation Points: 10
Solved Threads: 3
 
for example I want create a textfile named as text1.txt and another textfile text2.txt. What possibly is the solution to prevent the 1st txt file to be overwritten by the 2nd txt file.


Don't write the same thing to both files.

Why wouldtext1.txt get overwritten by text2.txt? they are two different files.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

if you are talking about writing two files at the same time then it simply a matter of opening them on different file unit numbers

open "text1.txt" for output on #1
open "text2.txt" for output on #2

print #1, "this will go in text1"
print #2, "this will go in tesxt2"

close #1
close #2
ChrisPadgham
Posting Pro in Training
413 posts since Sep 2009
Reputation Points: 102
Solved Threads: 78
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: