File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Writing header line to csv Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Writing header line to csv" Watch "Writing header line to csv" New topic

Writing header line to csv

Kat Mackay

Joined: Sep 02, 2010
Posts: 1
I'm sure there is a very simple way to do this but I am currently trying to use file.write

using the commas to denote the separate cells I want in the csv file. However this is not compiling - I get a 'not applicable argument' error from Eclipse.

Many thanks
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to JavaRanch

I dont know what you are tying to do. but if you are trying to do something with csv file then, consider *opencsv*. google for more detail
Lester Burnham

Joined: Oct 14, 2008
Posts: 1337
As it is, you're passing many, many parameters to file.write - when it actually only takes a single one. What you need to do is to escape the double quotes, so that they don't get interpreted by the Java compiler. Every double quote (except for the very first and the very last) must be preceded by a backslash. So the parameter would start as "Acc\",\"emPAI (al.....
I agree. Here's the link:
subject: Writing header line to csv
It's not a secret anymore!