This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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