Thanks every one for the reply.

Appreciated!!

Regards,
Chintan.

Wayne Keenan <[EMAIL PROTECTED]> wrote: ** I wouldn't roll your own CSV 
writer/reader, it's way more complex a problem than you may realise, and has 
been solved a thousand times before.

Instead I would go with a ready made one, such as:  
http://opencsv.sourceforge.net/
 

On Feb 5, 2008 1:19 PM, Vikash Mistry <[EMAIL PROTECTED]> wrote:
 **      Yes  there is.
  
 Have you managed to pull the data you want out using the Remedy Java  API?? If 
so, All you do is use the standard Java API for FileWriter. See  below:
  
 Please  note i havent compiled this and have written it from the top of my  
head.
  
  public static void  main(String[] args) {

 // Pull your data out using the Remedy Java  API
  
     String csvLine =  "";
     File csvFile = new File("c:\temp\file.csv");
      
     csvLine =  <data1> +","+ <data2>  +","+<etc..>
  
     // strip out  any carriage returns and line feeds
     csvLine =  csvLine.replaceALL(\\n,""  );
     csvLine  = csvLine.replaceALL(\\r,""  );
  
     // write to  file
     write2File(csvFile,  csvLine)
  
 }
  
 private static void  write2File(File file, String text) {
 try {
          FileWriter fw = new FileWriter(file,  true);
          fw.flush();
          fw.write(text);
          fw.close();
     } catch (IOException fe)  {
     System.out.println("Error  writing to file");
      fe.printStackTrace();
      }
 }
  
  
 Regards
  
 Vik

    -----Original Message-----
From: Action Request System    discussion list(ARSList) [mailto:[EMAIL 
PROTECTED] Behalf Of    Chintan Shah
Sent: 04 February 2008 21:01
To:    [email protected]
Subject: Is it possible to dump data into a CSV    file through Java API


** Hello all,

I am trying to    dump data returned on search into a CSV file.

Is there a way to do it    through Java API?

Thanks
Chintan.
      

---------------------------------
   Never miss a thing. Make Yahoo    your homepage. __Platinum Sponsor: 
www.rmsportal.com ARSlist: "Where the    Answers Are" html___ 



 __Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" html___ 



 __Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" html___ 

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to