|
-
Mar 9th, 2010, 09:37 AM
#1
Thread Starter
Member
outputting to a .txt file from J#
I am wondering how you would output from a program to a text file for data handling.
Any help would be much appreciated
-
Mar 9th, 2010, 10:01 AM
#2
Re: outputting to a .txt file from J#
-
Mar 9th, 2010, 01:54 PM
#3
Re: outputting to a .txt file from J#
Again, I've never used J#, but this is how you could do it in Java.
import
Then
Code:
//create the output stream
FileOutputStream out = new FileOutputStream("outFile.txt");
//create the print stream to write to the output stream
PrintStream p = new PrintStream(out);
//write to the printstream
p.println ("Write a line. You can also use print if you don't want to force a new line");
//and finally close
p.close();
-
Mar 13th, 2010, 07:31 AM
#4
Fanatic Member
Re: outputting to a .txt file from J#
In J#, it's pretty much the same way you'd do in Java (as outlined above), but instead you use the System.IO.StreamWriter object, and you'd use the StreamWriter equivalent to println. If you have experimented with any .NET programming languages, the latter should be obvious once you start using the StreamWriter object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|