none
sax get nothing but numbers from a large excel2007 and sharedStrings.xml is empty RRS feed

  • Question

  • Hi, 

    I am using Apache SAX (Event API) to process xlsx file (size-167 MB with around 7 lakh records). I want to upload this

    data to database. However, it gets nothing but numbers. String can't be read unless  the xlsx file is edited and saved. As

    far as I know,strings are stored in sharedStrings.xml. However,the sharedStrings.xml is 1 KB before i edit and save the

    xlsx file. After that, it's 90.8 KB.

    Any one please help me in resolving this issue. 

    Thanks in advance. 

    Friday, August 14, 2015 7:22 AM

Answers

  • Hi zhangleyi,

    I made a research about Apache SAX, it seems that it is a third party product, am I right? If you use a third party API, I suggest you go to the SAX site for help, they are more familiar with the APIs.

    >> I want to upload this data to database. However, it gets nothing but numbers. String can't be read unless  the xlsx file is edited and saved. As far as I know,strings are stored in sharedStrings.xml. However,the sharedStrings.xml is 1 KB before i edit and save the xlsx file. After that, it's 90.8 KB.

    Yes, you are right, strings are stored in sharedStrings.xml. But, I am not sure it needed to be edited and saved. What technology you used, Excel automation, Open XML SDK or a third party product?
    If you are using Open XML SDK or Excel automation, I think you could share us your code.

    For writing string with excel automation, you could use Range.Value. Something like below:

    Sub CellValue()
        ActiveSheet.range("A2").Value = "Hello Word"
    End Sub

    The link below shows how to insert text into a cell in a spreadsheet document with Open XML SDK.

    # How to: Insert text into a cell in a spreadsheet document (Open XML SDK)
    https://msdn.microsoft.com/en-us/library/office/cc861607.aspx

    Best Regards,

    Edward


    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.
    Click HERE to participate the survey.


    Monday, August 17, 2015 6:31 AM