![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Nov 2005
Posts: 35
Rep Power: 0
![]() |
Trouble writing to file
I need to get data out of my program and into a CSV file. For some reason, the output code that follows dosen't seem to work -- no file is created with the data being outputted. What am I missing? Maybe there's a better way to do output streams?
OutputStream out = new FileOutputStream("newRoster.csv");
String toWrite;
MemberInfoNode min = members.getHead();
while(min != null){
String id = min.getID();
String firstName = min.getFirstName();
String lastName = min.getLastName();
String instrument = min.getInstrument();
String bandColor = min.getBandColor();
int points = min.getPoints();
toWrite = id + "," + firstName + "," + lastName + "," + instrument +
"," + bandColor + "," + points;
byte buf[] = toWrite.getBytes();
out.write(buf); |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Nov 2005
Posts: 35
Rep Power: 0
![]() |
Never mind, it does work! It was putting the file somewhere I wasn't expecting.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|