I am generating a CSV file from a dataobject.  The output from it looks like
this when opened in a text editor:
  
IDNum,Day,Hour
00773908,1999-09-19 09:00:00.000,1999-09-19 09:00:00.000
00773908,1999-09-19 10:00:00.000,1999-09-19 10:00:00.000
00773908,1999-09-19 11:00:00.000,1999-09-19 11:00:00.000
00773908,1999-09-19 12:00:00.000,1999-09-19 12:00:00.000
00773908,1999-09-19 13:00:00.000,1999-09-19 13:00:00.000
00773908,1999-09-19 14:00:00.000,1999-09-19 14:00:00.000
00773908,1999-09-19 15:00:00.000,1999-09-19 15:00:00.000
00773908,1999-09-19 16:00:00.000,1999-09-19 16:00:00.000
00773908,1999-09-19 17:00:00.000,1999-09-19 17:00:00.000
00773908,1999-09-19 18:00:00.000,1999-09-19 18:00:00.000
00773908,1999-09-19 19:00:00.000,1999-09-19 19:00:00.000
00773908,1999-09-19 20:00:00.000,1999-09-19 20:00:00.000

When the file is opened in excel, it sets the second and third columns to a
Time cell format.  This seems to be an excel thing.  I'd like to have one in
day format and the other in hour format.  What I see in excel is this:

 <<...>> 

any ideas on how to work around this?  The code is as follows:

                   try {                
                      PrintWriter outfile = 
                         new PrintWriter(new BufferedWriter(new
FileWriter(path + fileName)));
                      recOut = "IDNum," +
                               "Day," +
                               "Hour"; 
                      outfile.println(recOut);           
                      for (int i = 0;i < nbrRows;i++) {
                          recOut = myDo.getValue(i,"dfIDNum") + "," + 
        
myDo.getValue(i,"dfPRODUCTION_DATE_START") + "," + 
        
myDo.getValue(i,"dfPRODUCTION_DATE_START");        
                        outfile.println(recOut);} 
                      outfile.close();  
                     }   
                   catch (IOException e) {
                       System.out.println("IO Error");return(0);
                      }


PG&E Gas Transmission Texas and any other company referenced herein which uses the 
PG&E name or logo are not the same company as Pacific Gas and Electric Company, the 
California utility.  These companies are not regulated by the California Public 
Utilities Commission, and customers do not have to buy products from these companies 
in order to continue to receive quality regulated services from the utility.
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to