ExcelDataReader can t read html-format file

0 votes

I have the following code:

        MemoryStream ms = new MemoryStream();
        using (var fileStream = File.OpenRead("G:\\tmp\\abc.xls"))
        {
            fileStream.CopyTo(ms);
        }
        var reader = ExcelReaderFactory.CreateReader(ms);

Where file abc.xls has the following format:

<div>
    <table cellspacing="0" rules="all" border="1" style="border-collapse:collapse;">
        <tr>
            <th scope="col">Device Name</th><th scope="col">Model Number</th><th scope="col">Software Version</th><th scope="col">ELD Identifier</th><th scope="col">Company Name</th><th scope="col">Phone</th><th scope="col">Email</th><th scope="col">Website</th><th scope="col">Mailing Address</th><th scope="col">City, State, and Zip</th><th scope="col">Data Transfer Options</th>
        </tr><tr>
            <td>XXX ELD - iOS 2.0</td><td>20I</td><td>Version 3 and higher</td><td>20XX03</td><td>J. J. XX&amp; Associates, Inc.</td><td>XXX-XXX-XXXX</td><td>support@XXXX.com</td><td>www.XXX.com/elogs</td><td>3003 XXXLane</td><td>Neenah, WI 54957</td><td>Telematic (Web Service, Email)</td>
        </tr><tr>
        ......
        </tr>
</table>

But I got an error:

ExcelDataReader.Exceptions.HeaderException: Invalid file signature. [2023-04-10T02:43:50.481Z] at ExcelDataReader.ExcelReaderFactory.CreateReader(Stream fileStream, ExcelReaderConfiguration configuration)

What is wrong in my case and how to fix?

Apr 11, 2023 in Others by Kithuzzz
• 38,000 points
677 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
1 answer

Get files in my own file format for its own dynamic icon

Regarding MAC support, "The Mac and Windows ...READ MORE

answered Jan 8, 2019 in Others by DataKing99
• 8,250 points
1,107 views
0 votes
1 answer

TCPDF ERROR: Some data has already been output, can't send PDF file

To answer your question, do add the ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
4,205 views
0 votes
1 answer

Arduino IDE can't find ESP8266WiFi.h file

Customisation and selection of the correct card ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
9,960 views
0 votes
0 answers

Creating an Instagram bot with reading an excel file and posing on Instagram, but some of words can not be read properly

from instabot import Bot import openpyxl import smtplib bot = ...READ MORE

Sep 26, 2022 in Others by Kithuzzz
• 38,000 points
802 views
0 votes
1 answer

How can I convert excel to PDF by Libreoffice and keep all format from excel file?

"Times New Roman" typeface does not have ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,648 views
0 votes
1 answer

Uipath(RPA) : read data from the PDF file and write to Excel file

If you want to use UiPath and ...READ MORE

answered Oct 17, 2022 in Others by narikkadan
• 63,600 points
2,154 views
0 votes
1 answer

Deleting duplicate rows in Excel using Epplus

You need to re-think this… the while ...READ MORE

answered Feb 23, 2022 in Database by gaurav
• 23,260 points
1,470 views
0 votes
1 answer

Export DataTable to Excel File

Add Interop References. First we need to ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 23,260 points
773 views
0 votes
1 answer

How to create and download excel document using asp.net

First, download the Open XML Format SDK 2.0. It comes ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
2,943 views
0 votes
1 answer

Merge and export Excel/Word/PDF to PDF

Use GroupDocs.Merger for .NET API to merge Word, Excel, ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,471 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP