I'm very new to Java and I'm basically teaching myself. I'm writing a program where I need to plot some values. I have a while loop and I need to print x and y values to a text file that I can later graph using gnuplot. If someone can help me make two colums of x and y values to a text file I would really appreciate it!
gor.irina
0
Newbie Poster
Recommended Answers
Jump to PostBy columns I assume you mean two fields of data separated by some spaces on the same line. The line ending with a newline character.
When you build the record insert the number of spaces between the two fields and add a newline char at the end:
String rec = …
Jump to Post...or based on the second column if you want the columns to be right justified.
What sort of input does gnuplot want? Fixed-width, delimited?
Jump to PostDo you have any questions on how to create the file you need?
All 12 Replies
NormR1
563
Posting Sage
Team Colleague
jon.kiparsky
326
Posting Virtuoso
gor.irina
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
gor.irina
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
gor.irina
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
gor.irina
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
java_programmer
0
Junior Poster
java_programmer
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.