Muzzamil
unread,Jul 29, 2012, 5:41:13 AM7/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to seleniu...@googlegroups.com
Hello all,
Here is my code,
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
public class WriteToFileCsv
{
public static void main(String[] args) throws IOException
{
FileWriter fw = new FileWriter("WriteTest.csv");
PrintWriter out = new PrintWriter(fw);
// ',' divides the word into columns
out.print("This");// first row first column
out.print(",");
out.print("is");// first row second column
out.print(",");
out.println("amazing");// first row third column
out.print("It's"); // second row first column.
out.print(",");
out.print("really");// second row second column
out.print(",");
out.print("amazing");// second row third column
//Flush the output to the file
out.flush();
//Close the Print Writer
out.close();
//Close the File Writer
fw.close();
}
}
but i want to enter data in a specific column like 4th, 5th ...etc
how i can modify this code.
Pls suggest
Thanks,
Muzzamil