Data written to excel string is text rather than double when opened in excel

I have code that combines a time string, numerous double arays and a couple of individual doubles. All seems to work well except when I open the created data file in excel, the first cell after the time string is always a string and not numeric. This is the first value in a double aray and all the other elements of the array are correctly converted to numbers. Only the first element is being interpreted incorrectly. This is messing up an other wise nice spreadsheet.
Any thoughts?
Solved!
Go to Solution.
Attachments:
WriteRecord.png ‏43 KB

The problem is Excel.  When Excel gets a text file, it isn't actually opening the file, it is importing it.  It has default settings it uses for how to parse the data.  It seems to have no problem recognizing a tab as a cell separator, but it doesn't recognize a comma has a cell separator.  In older Excel, you could do a File/Import, and you'd have to intentionally check the checkbox for a comma to be a delimiter.
I really think Microsoft was pretty stupid on this point.  Excel recognizes CSV as a file type to import.  CSV stands for Comma Separated Values.  Yet Excel doesn't treat the comma as a separator.
Do you have to use a comma as a separator, or can you use a tab?
Your code is kind of convoluted (as pointed out by others).  Your combining string manipulations with array to spreadsheet string making a comma has a delimiter, then building an array, then writing that 2 column array to a file using Write to Spreadsheet file where now the tab is your delimiter.  That is why the first column sort of works.  Excel understands the tab.
That whole section of code really needs to be rewritten and use a consistent format.

Similar Messages

  • Certain Pages display as text rather than HTML. Yahoo and Google for example

    Certain pages are displaying as text rather than HTML. Bing displays correctly but Yahoo, and google do not. Tried a lot of settngs but to no avail. Any suggestions?

    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache and
    * Remove Cookies '''''Warning ! ! '' This will log you out of sites you're logged in to.'''
    Type '''about:preferences''' in the address bar and press enter.
    * '''Cookies;''' Select '''Privacy.''' Under '''History,''' select Firefox will '''Use Custom Settings.''' Press the button on the right side called '''Show Cookies.''' Use the search bar to look for the site. Note; There may be more than one entry. Remove '''All''' of them.
    * '''Cache;''' Select '''Advanced > Network.''' Across from '''Cached Web Content,''' Press '''Clear Now.'''
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences''' in the address bar and press enter
    Select '''Advanced > General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • "Last modified" attribute changes when opening a Excel-document

    Hi
    We are running Server 2008 R2 as terminal servers and fileserver. 
    When opening an Excel document stored on the fileserver so changes "date modified" at the opening regardless if you save the document or not. This is a problem for users who want to keep track of when the document has been changed "for real".
    Now, "last modified" changes when the document was last read instead, this confuse the users...
    If we test the same procedure on our older terminal server environment, Server 2003 or on our clients (Windows 7) it works how we wanted. The "last modified" only changes when you save the document, and not when you are opening it. Office
    2007 is installed on both our new terminal server environment (Server 2008 R2) and the old one (Server 2003). 
    Can someone explain to me why it behaves like this? And if anyone got a solution? It's only occur on Excel-documents and not the others Office documents...
    Thanks in advance

    Hi tomburken,
    It seems that this is not a server issue .
    This issue may due to the " automatically save " executed by some office scripts .
    To get the accurate assistance please post this issue to Microsoft office forum :
    http://social.technet.microsoft.com/Forums/zh-CN/home?category=officeitpro&filter=alllanguages
    Best Regards
    Elton JI
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Why does some text convert to outlines when opening a PDF in AI?

    I often have to open PDFs saved from InDesign CS5 in Illustrator CS5 (Mac). These PDFS are saved from InDesign using Press or PDFX1-a settings.
    When I open them in AI, I get the warning that "to preserve appearance, some text has been outlined".
    Of course, I do not want this to happen.
    The text that gets outlined is nothing special. It is seemingly at random within a paragraph or within a cell of a table. In the screen shot below, live text has the blue underline; outlined text does not.
    I can see no rationale for it. There is no transparency involved. Just black text on no background. There is no special "appearance" that needs to be preserved. Fonts are all Adobe OTF (Myriad Pro shown below).
    Can anyone explain why this happens?

    PDFs are not supposed to be edited as a rule.
    Lots of odd things can happen to text (but also other objects) when you open a PDF - that is not a pdf with the editable Illustrator file saved within it - and try to edit it.
    Illustrator is not a general purpose editor of pdf files.
    PDF files are supposed to be an end-format, not a format that you edit.
    What happens to text in a pdf when opened in Illustrator is perfectly normal. There isn't really much you can do about it except recreate the text in Illustrator from scratch, with the desired font, and re-export to the pdf-version you need.

  • Cell calculations showing header text rather than data

    This has to be simple, but I am stumped.
    I have added header text to a SS.  Now when I attempt to add a calculation to a cell in the SS Numbers is showing the text in the calculation rather than the cell data or cell location.
    How do I stop this?  Just want to see something like this:  =F13-(E13*4)
    but I get this
    =On Hand Now test line-(Monthly Average test line*Cal. 212 West Jackson Street)
    Numbers does put the the correct numeric result in the proper cell but I don't want to see the above.
    Tim

    select the menu item "Numbers > Preferences" then uncheck the box "Use header cell names as references":

  • Messages all of a sudden sending as text rather than iMessage

    My boyfriend and I text every day and we both have iPhone 4's So it sends as iMessage. Ever since last night our texts have been sending as text message rather than iMessage and we cant figure out why. Were guessing it's on his end since I can text other people on iMessage. yesterday his keyboard wouldn't come up so he turned it off and back on and shortly after that our messages would only be sent as text. We've checked to make sure iMessage is on and that our 3G is up and running so if anyone has any ideas that'd be great. Would doing a restart (ie. Holding power and home) do anything?

    how are you sending the iMessage? via Phone Number or Email address. Try it thru email address. If still same make sure he has the updated iOS, good internet connection and he can restart iMessage.

  • Firefox 4.0 - scroll wheel shrinks text rather than scrolling the page down

    On some web pages, when I use the scroll wheel on my mouse to scroll down, the page text shrinks, as if I'd done the appropriate gesture on a mobile browser. Reversing the scroll wheel direction enlarges the text. Moreover, the page down key seems to switch me to another tab, rather than moving down in the same page.
    I first thought that the scroll wheel problem does not affect all pages. However, it now seems that it has stopped misbehaving. I just went back to a firefox window containing a page I thought had misbehaved earlier, and the scroll wheel now behaves normally and so does the page down key.
    I upgraded to firefox 4.0, and told it to restore the tabs I had had open in the previous firefox version. The scroll wheel had behaved normally in that version.
    I have not closed and restarted firefox since the upgrade. I don't recall what version I had been running, but I generally upgrade promptly when a new version is available, so I was probably on the latest of the previous series.

    Try to close and restart or even reboot the computer to see if that helps. Sounds that the Ctrl key somehow got stuck in Firefox because zooming is the behavior if you press Ctrl and use the scroll wheel.

  • Bug : Invalid file extension error when opening exported excel

    Hi All,
    In one of my jsff page, i have implemented 'exportToExcel' functionality through a exportcollectionactionlistener on a table to export its data to excel. When i try opening the generated excel, i get the following warning in excel 2007 :
    "The file you are trying to open, 'Export.xls,' is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" - When I clicked YES to the message, the exported excel opened and data is present.
    How can i get rid of this warning message, because it is annoying for any user to click YES every time the excel is opened ? I am using jdev version 11.1.1.6.0 This is my code :
    <af:commandToolbarButton text="Export to Excel" id="cb1">
    <af:exportCollectionActionListener exportedId="t1"
                               type="excelHTML"
                               filename="Export.xls"
                               title="Excel export"/>
    </af:commandToolbarButton>I found a similar forum post here File format of exportCollectionActionListener ADF 11g But they are suggesting a registry fix which is not possible in production environment.
    Any possible workaround or suggestions to resolve this issue is much appreciated.
    Thanks

    You can save the data on the client and the check the data.
    Have you considered using POI to generate real xsl workbook files?
    Timo

  • Error when opening exported Excel document

    hi,
    i'm using the following to let the user export JSP to Excel file:
    response.setContentType("application/download ");
    response.setHeader("Content-Disposition","attachment; filename=test.xls");
    problem happens only for the first when i try to open the file in excel.
    Excel gives me " 'test.xls[1]' could not be found. Check the spelling of the file name, and verify that the file location is correct. ...."
    Subsequent tries work fine with no problem.
    i noticed that Excel is trying to open a file with a different name, appending [1], which obviosuly doesn't find in its first try.
    i would appreciate any kind of clue.
    thank you.

    I got this from a different post on this forum.
    Basically, on your JSP page which you want to export to Excel, set the content type and header as below. Then the browser(Internet Explorer) will try to open the excel document in itself.
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment; filename=" + "test.xls" );
    %>
    <HTML>
    <head>
    <title>Excel Compatible HTML</title>
    <style type="text/css">
    td.currencyCustom { mso-number-format:"$#,##0.00_);[Red]($#,##0.00)"; text-align: right; }
    td.currencyDefault { mso-number-format:"Currency"; text-align: right; }
    td.integer { mso-number-format:"#,##0_);[Red](#,##0)"; text-align: right; }
    td.percent { mso-number-format:"%0.00"; text-align: right; }
    </style>
    </head>
    <body>
    <table summary="Excel formats supported" width="500">
    <tr><td colspan="2"><h1>Excel Compatible HTML</h1></td></tr>
    <tr><td colspan="2"><p>This is a simple demo of how HTML tables can be extended
    by using CSS styles recognized by Excel 2000. I haven't yet
    been able to find any documentation on these styles. Most of this was
    derived by saving a simple spreadsheet using the <i>Save as Web Page ...</i>
    option then experimenting with formats using the <code>mso-number-format</code>
    CSS attribute.</p>
    <p>Excel will convert unformatted numbers to the specified style so formatting
    them isn't required if the output is only to be used by Excel. Otherwise, they
    should be formatted to display correctly in browsers.</p>
    <!--[if !excel]>  <![endif]-->
    </td></tr>
    <tr><td>12,345.60 with class="currencyCustom":</td><td class="currencyCustom">12,345.60</td></tr>
    <tr><td>12345.6 with class="currencyCustom":</td><td class="currencyCustom">12345.6</td></tr>
    <tr><td>-12,345.60 with class="currencyCustom":</td><td class="currencyCustom">-12,345.60</td></tr>
    <tr><td>-12345.6 with class="currencyDefault":</td><td halign="right" class="currencyDefault" x:num="-12345.6">($12,345.60)</td></tr>
    <tr><td colspan="2"> </td></tr>
    <tr><td>123456789 with class="integer":</td><td class="integer">123456789</td></tr>
    <tr><td>-123456789 with class="integer":</td><td class="integer">-123456789</td></tr>
    <tr><td>123,456,789 with class="integer"</td><td class="integer">123,456,789</td></tr>
    <tr><td>-123,456,789 with class="integer"</td><td class="integer">-123,456,789</td></tr>
    <tr><td colspan="2"> </td></tr>
    <tr><td>%100.00 with class="percent":</td><td class="percent">%100.00</td></tr>
    <tr><td>%43.21 with class="percent":</td><td class="percent">%43.21</td></tr>
    <tr><td>1.0 with class="percent":</td><td class="percent">1.0</td></tr>
    <tr><td>0.4321 with class="percent":</td><td class="percent">0.4321</td></tr>
    </table>
    </body>
    </html>
    Currently, i'm trying a different approach.
    I'm using POI from jakarta site to create Excel file manually.
    here's a snippet of my code in my web request handler that creates an Excel file.
    String exportType =(String) request.getParameter("export_type");
    if(exportType!=null && exportType.equals(WebConstants.EXPORT_TYPE_MS_EXCEL))
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.createSheet("Test Sheet");
    HSSFCell cell = null;
    HSSFCellStyle cellStyle = workbook.createCellStyle();
    HSSFFont font = workbook.createFont();
    font.setColor((short)0xc);
    font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    cellStyle.setFont(font);
    HSSFRow titleRow = sheet.createRow((short)0);
    cell = titleRow.createCell((short)0);
    cell.setCellValue("Order ID");
    cell.setCellStyle(cellStyle);
    cell = titleRow.createCell((short)1);
    cell.setCellValue("Order Time");
    cell.setCellStyle(cellStyle);
    for(short i=0; i<blotterModelList.size(); i++)
    BlotterModel model = (BlotterModel)blotterModelList.get(i);
    HSSFRow row = sheet.createRow((short)(i+1));
    row.createCell((short)0).setCellValue(model.getOrderId());
    row.createCell((short)1).setCellValue(model.getOrderTime());
    ServletOutputStream stream = response.getOutputStream();
    response.setContentType("application/vnd.ms-excel");
    workbook.write(stream);
    stream.flush();
    stream.close();
    Sir: I am having touble with my excel exporting.
    Could you show me what you are doing and I can go to
    school on it? Thanks!

  • PDF form text fields' options change when opened in READER on a MAC.

    I created a PDF form using Adobe X PRO. All fields are UNCHECKED for Property/Options/ "scroll long text". I save and distribute the form as a "reader extended pdf/enable additional features" so it can be saved and returned using READER.
    When a Mac user opens the extended form in Adobe READER, ALL the text fields change to scroll. When he returns the completed form to me, every text field, even signature and date fields, are changed to scroll text.
    What is happening in the transition from PC to MAC?

    Preview is the default PDF viewer on the Mac. It should never be used with PDF forms. Just let them know that they should use Adobe Reader. Provide a link or URL where it can be downloaded and let them know that it's free.
    There are things you can do so that it doesn't work in Preview, but it involves some scripting. If interested in this approach, post again.

  • Excel 2013 (office 365) crashes every time I opened a excel file directly from Browser or zip file.

    Hi guys,
    I got a problem with my Office 365 that every time I open an office file from IE/chrome browser (i.e. click the document link and save the file to local, open it in the browser after download completed) or under a zip file, no matter it is an excel file
    or word document, the Excel/Word crashes. The Excel/Word will ask me to repair the file if I open the file again. The file will be closed automatically after the repair, when I open the file again it will told me the excel/word itself has just successfully
    registered and ask me to close and re-open the excel again in order to enable editing the file. This is extremely inconvenience, I have to open this file 4 times to edit my file. 
    Could anyone here can help me to resolve the problem?
    Many thanks.

    Hi,
    According to your description, Excel seems not crash when you opened a local Excel/Word file directly. Where do you store these file? OneDrive, SharePoint or other?
    If possible, please let me see the screenshot of the error dialog.
    Moreover, please open Event Viewer to check whether there's any error about the Excel/Word crash issue.
    Press Win + R, type "eventvwr" in the blank box, press Enter. In the Event Viewer, browse to Windows Logs -> Application, there may be some errors after the crash.
    To protect your privacy, you may send the error logs to
    [email protected], we will try to find the cause.
    Regards,
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Missing worksheet when opening in EXCEL 2013

    Hi,
    I had an output from our existing ERP system with file type as XLS.
    Currently, if open in EXCEL 2010, I am able to view the workbook with multiple sheet.
    However, now, in EXCEL 2013, I cannot geth the same result. I get only to view 1 sheet with 1 sheet missing from the open workbook.
    Why is this happeneing? No problem in EXCEL 2010.
    Please assist.
    Bye

    Hi,
    If this is not a SharePoint related issue, I would suggest you open a thread in the corresponding forum, you will get more help and confirmed answers there.
    Thanks 
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • FF4, Win7 - is there a way to pin the History to the left side of the page, rather than having it open in a whole 'nother window?(Where it used to be!)

    FF4, Win7x64 - Is there a way to pin History to the left side of the FF page - the way it was - rather than having to click Bookmarks and a new window opens and then one must click history etc etc etc-

    Press Ctrl+H with your browser open, and it will display the history pane on the left of your screen.

  • When clicking on an attachment to an email, it will only save rather than save or open. How can I change the setting to allow me to open an attachment before deciding whether or not to save it?

    There is a dialog box that appears when I click on an email attachment that asks whether to open or save a .pdf document, and whether I always want that action to be taken. However, when clicking a .doc or .docx document, I no longer have the choice. How can I revive the dialog box to choose to 'open' the file rather than being forced to 'save' the file?

    Try to clear the cache.
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    See also:
    * http://kb.mozillazine.org/File_types_and_download_actions
    You can rename such files with a .html file extension and give them a .jpg file extension to make applications see them as an image.<br />
    If Windows is stubborn and keeps the .html file extension and you end up with image.jpg.html then add quotes around the name ("image.jpg")

  • Mountain lion has small text size in iWork when opening a file

    when opening a new file in iwork using mountain lion, the text size is very very small.  how do you change this?
    as resolution gets higher, text size gets smaller and we start to squint all the time.  not good for my eyes.

    twotwo22 wrote:
    My computer went into blue screen crash in the midst of a file save
    Do you have a backup?
    Is Time Machine or another backup software running?
    How's the file size?

Maybe you are looking for

  • Flash newbie needs help

    i'm quite a newbie when it comes to flash and need some help http://www.sas.se/sv/?vst=true you look to the right you'll see an airplane and i'll say "Billiga avgångar" next too it under the text you can see text in yellow being scrambled then reappe

  • Problem using/opening Aperture 3.0 Library in Aperture 3.5.1

    I have Aperture 3.0 Library that I opened in Aperture 3.5.1 and got this: I did all repairs and rebuilds, but noting works. I can't access any PS file that I have, and the exports from the library looks like this: Any suggestions how to save my image

  • Delivary Problem

    Dear all SO is for 3 quantity.2 already delivered,invoiced. While doing delivary VL01N for the remaing one,system is showing error like zero stock available despite stock availability in concerned storage location. 1.In MMBE it is showing stock is 4

  • Using iTunes Visualizer as the automatic Screensaver

    The Visualizer in iTunes is VERY cool. Is there any way to make this appear as the automatic screensaver while playing music in iTunes?

  • Where is my Presario Cd web's microphone located?

    Am using Skype and have been told that cannot be heard easily. Where is the microphone located on my Presario CQ60?