Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing header line to csv

 
Kat Mackay
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic